Added the ability for users to add/remove themseleves to/from groups.
This commit is contained in:
parent
c4830a3641
commit
b7512be833
7 changed files with 201 additions and 5 deletions
33
lib/WebGUI/Macro/GroupAdd.pm
Normal file
33
lib/WebGUI/Macro/GroupAdd.pm
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package WebGUI::Macro::GroupAdd;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2003 Plain Black LLC.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::Group;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::URL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my @param = WebGUI::Macro::getParams($_[0]);
|
||||
return "" if ($param[0] eq "");
|
||||
my $g = WebGUI::Group->find($param[0]);
|
||||
return "" if ($g->groupId eq "");
|
||||
return "" unless ($g->autoAdd);
|
||||
return "" if (WebGUI::Privilege::isInGroup($g->groupId));
|
||||
return '<a href="'.WebGUI::URL::page("op=autoAddToGroup&groupId=".$g->groupId).'">'.$param[1].'</a>';
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue