Gossamer Forum
Quote Reply
Importing users
Hi

A while back I useds a script to import a list of users emails to links users databse:



#!/usr/bin/perl
#=====================================================
# User importer by me.
#=====================================================

use lib '/home/virtual/site315/fst/var/www/cgi-bin/links/admin';
use Links qw/$DB $IN/;


Links::init('/home/virtual/site315/fst/var/www/cgi-bin/links/admin');

$| = 1;

main();

#=====================================================

sub main {
#-----------------------------------------------------
# Import the users.

my $user = $DB->table('Users');
my $class = __PACKAGE__;

open DB, "/home/virtual/site315/fst/var/www/cgi-bin/links/users.db" || die $!;
while (chomp ($_ = <DB>)) {
$user->insert( { Username => $class->rand, Password => $class->rand, Email => $_ } );
print "Imported: $_\n";
}
close DB;
}

sub rand {
#-----------------------------------------------------
# Generate a random username.

my $chr = ['a'..'z', 'A'..'Z', 0..9];
my $rnd;

$rnd .= $chr->[rand @$chr] for (1..8);
$rnd;
}



Now



Can that code be changed so the same thing can be done with the Gforum?

I mean provide a list of email addresses (from Link SQL) and the script will import the list to the Gforum databse..!!

Since the users can change there name and password that should be easy to do..

Anyone has a suggestion...
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory