[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-users] users



I found this script on cobalts site anyone know what kind of input it would
need to make it work format an such?? I need to import a large number of
users into it from 2 diffrent domains

Joe Lange
Systems Administrator
NCIData.com
Methow.com

 #!/usr/bin/perl


# Cobalt Networks, INC 10-5-98
# This script is not supported

use strict;
use Cobalt::User;
use Cobalt::Network;
use Cobalt::List;

# Setup for file input
my ($error_file) = "Usage: massadd.pl
";
my ($error_help) = "Usage: massadd.pl --help
";

# This set the default of 5MB quota for each user
my ($quota) = 5048;

# The site_name will be the first 12 chars of the full site name
# A virtual site of test.test.com would have a site name of test.test.co
# NOTE: home is the default site name for the RaQ
my ($site_name) = "test.test.co";

# Disables telnet access for all users adding using this script
my ($shell) = "/bin/badsh";

# Other variables read in from the file
my ($fullname);
my ($passwd);
my ($uid);
my ($f_name);
my ($l_name);
my ($line);
my ($arg);

# open(PASSIT, "password-list") or die "Can't open password file $!
";
if (@ARGV)

foreach $arg (@ARGV)

if ($arg eq
help"){ 
print $error_file; 
print "The file should be your import file 
"; 
die; 
} 
else { 
open(PASSIT, $arg) or die $error_file, $error_help; 
} 
} 


} else { 
die $error_file, $error_help; 
} 


while ($line = ) { 
($fullname, $uid, $passwd, $f_name) = split(/[ ,]/, $line); 
# chomp($f_name); 
# Not used since full name is in the file 
# $fullname = join(' ', $f_name, $l_name); 
print user_add($uid,$fullname,$passwd,$quota,$shell,$site_name); 
print " 
"; 
print list_add_user("${site_name}-users",$uid); 
print " 
"; 
} 
close(PASSIT); 

# Updates the UserList 
$ENV{ PARAM_GROUP } = $site_name; 
system "/usr/admserv/cgi-bin/.cobalt/siteUserList/siteUserList.cgi";