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

Re: [cobalt-developers] add user script



be sure it is not something silly, that got me, be sure that the # of users
listed at one time is not set to one in the site settings. I was only
seeing one user, until my count was spotted, we upped the counter and all
my users showed up.

At 08:19 AM 5/30/2001 +0200, you wrote:
>Hi
>
>I use the following script to automatically add huge # of users.
>I can add useres so far with it, but they arn't  show in the users list of
>the site in the HTML Gui.
>
>do I miss something ?
>
>
>Peter
>
>
>
>#!/usr/bin/perl
># pass a comma separated list of
>#
># username,fullname,password
>#
>
>use Getopt::Std;
>require Cobalt::User;
>use Cobalt::Meta;
>
>my $addfile = '/tmp/users.dat'; # the file which contains the users to be
>added
>my $group = "site1"; # Change the group to the one for Virtual Site you
>wanted
>my $quota = 5;       # Disk quota in MB
>my $fpx = "off";     # Front Page Support
>my $apop = "off";    # Apop support
>my $admin = "off";   # User is admin or not
>my $shell = "off";   # allow shell access
>open IN, $addfile;
>flock (IN,2);
>@userdata = <IN>;
>close IN;
>foreach $usr (@userdata) {
>	chomp($usr);
>    ($username, $name, $passwd) = split(/\,/,$usr);
>	print "creating $username ...";
>	my $m = Cobalt::Meta->new("type" => "users",
>    "name" => "$username",
>    "group" => "$group",
>    "fullname" => "$name",
>    "altname" => "",
>    "password1" => "$passwd",
>    "password2" => "$passwd",
>    "quota" => "$quota",
>    "fpx" => "$fpx",
>    "apop" => "$apop",
>    "shell" => "$shell",
>    "admin" => "$admin",
>    "suspend" => "",
>    "aliases" => "",
>    "forward" => "",
>    "vacation" => "",
>    "vacationmsg" => "");
>	print "m: $m";
> 	my $res = &Cobalt::User::site_user_add($m);
> 	if ($res) {
>     print "  ERROR: $res\n";
> 	} else {
>    	print "ok\n";
> 	}
>}
>
>_______________________________________________
>cobalt-developers mailing list
>cobalt-developers@xxxxxxxxxxxxxxx
>http://list.cobalt.com/mailman/listinfo/cobalt-developers