Added isVisitor, isAdmin, and isRegistered methods to User object instead

of hard coding checks everywhere with group ids. And updated the code base 
   to match.
This commit is contained in:
JT Smith 2008-09-16 22:32:36 +00:00
parent 586164d8d0
commit ef120fb06b
52 changed files with 201 additions and 118 deletions

View file

@ -46,7 +46,7 @@ sub process {
my ($session, $groupName, $text, $template) = @_;
return "" if ($groupName eq "");
return "" if ($text eq "");
return "" if ($session->user->userId eq '1');
return "" if ($session->user->isVisitor);
my $g = WebGUI::Group->find($session, $groupName);
return "" unless defined $g->getId;
return "" unless ($g->autoAdd);

View file

@ -46,7 +46,7 @@ sub process {
my ($session, $groupName, $text, $template) = @_;
return "" if ($groupName eq "");
return "" if ($text eq "");
return "" if ($session->user->userId eq '1');
return "" if ($session->user->isVisitor);
my $g = WebGUI::Group->find($session, $groupName);
return "" unless defined $g->getId;
return "" unless ($g->autoDelete);

View file

@ -51,7 +51,7 @@ sub process {
my $login = $param[0] || $i18n->get(716);
my $logout = $param[1] || $i18n->get(717);
my %var;
if ($session->user->userId eq '1') {
if ($session->user->isVisitor) {
return $session->url->page("op=auth;method=init") if ($param[0] eq "linkonly");
$var{'toggle.url'} = $session->url->page('op=auth;method=init');
$var{'toggle.text'} = $login;