[freeside-commits] freeside/FS/bin freeside-adduser, 1.11,
1.12 freeside-addgroup, NONE, 1.1
Ivan,,,
ivan at wavetail.420.am
Tue Jul 4 05:01:05 PDT 2006
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail:/tmp/cvs-serv854/bin
Modified Files:
freeside-adduser
Added Files:
freeside-addgroup
Log Message:
adding freeside-addgroup
Index: freeside-adduser
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-adduser,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- freeside-adduser 30 Jun 2006 14:30:26 -0000 1.11
+++ freeside-adduser 4 Jul 2006 12:01:02 -0000 1.12
@@ -1,6 +1,4 @@
#!/usr/bin/perl -w
-#
-# $Id$
use strict;
use vars qw($opt_h $opt_b $opt_c $opt_g);
--- NEW FILE: freeside-addgroup ---
#!/usr/bin/perl
use strict;
use vars qw($opt_s);
use Getopt::Std;
use FS::UID qw(adminsuidsetup);
use FS::Record qw(qsearch);
use FS::CurrentUser;
use FS::AccessRight;
use FS::access_group;
use FS::access_right;
use FS::access_groupagent;
getopts("s");
my $user = shift or die &usage; #just for adminsuidsetup
my $group = shift or die &usage;
$FS::CurrentUser::upgrade_hack = 1;
#adminsuidsetup $rootuser;
adminsuidsetup $user;
my $access_group = new FS::access_group { 'groupname' => $group };
my $error = $access_group->insert;
die $error if $error;
if ( $opt_s ) {
foreach my $rightname ( FS::AccessRight->rights ) {
my $access_right = new FS::access_right {
'righttype' => 'FS::access_group',
'rightobjnum' => $access_group->groupnum,
'rightname' => $rightname,
};
my $ar_error = $access_right->insert;
die $ar_error if $ar_error;
}
foreach my $agent ( qsearch('agent', {} ) ) {
my $access_groupagent = new FS::access_groupagent {
'groupnum' => $access_group->groupnum,
'agentnum' => $agent->agentnum,
};
my $aga_error = $access_groupagent->insert;
die $aga_error if $aga_error;
}
}
sub usage {
die "Usage:\n\n freeside-addgroup [ -s ] username groupname"
}
More information about the freeside-commits
mailing list