Made visitor and registered users groups magic.

This commit is contained in:
JT Smith 2002-06-22 18:25:53 +00:00
parent 68b4baeb7e
commit e8b4e734f9
3 changed files with 17 additions and 6 deletions

View file

@ -250,7 +250,6 @@ sub www_createAccountSave {
foreach $fieldName (keys %{$profile}) {
$u->profileField($fieldName,${$profile}{$fieldName});
}
$u->addToGroups([2]);
WebGUI::Session::start($u->userId);
_logLogin($u->userId,"success");
WebGUI::MessageLog::addEntry('',$session{setting}{onNewUserAlertGroup},'',536) if ($session{setting}{alertOnNewUser});

View file

@ -62,7 +62,7 @@ sub www_addUser {
$f->select("authMethod",\%hash,WebGUI::International::get(164),[$session{setting}{authMethod}]);
$f->url("ldapURL",WebGUI::International::get(165),$session{setting}{ldapURL});
$f->text("connectDN",WebGUI::International::get(166),$session{form}{connectDN});
$f->group("groups",WebGUI::International::get(89),[2],5,1);
$f->group("groups",WebGUI::International::get(89),[],5,1);
$f->submit;
$output .= $f->print;
} else {

View file

@ -113,13 +113,25 @@ sub isInGroup {
if ($uid eq "") {
$uid = $session{user}{userId};
}
### The "Everyone" group automatically returns true.
if ($gid == 7) {
return 1;
### The "Everyone" group automatically returns true.
if ($gid == 7) {
return 1;
}
### The "Visitor" group returns false, unless the user is visitor.
if ($gid == 1) {
if ($uid == 1) {
return 1;
} else {
return 0;
}
}
### The "Registered Users" group returns true if user is not visitor.
if ($gid==2 && $uid != 1) {
return 1;
}
### Lookup the actual grouping.
@data = WebGUI::SQL->quickArray("select count(*) from groupings where groupId='$gid' and userId='$uid' and expireDate>".time());
if ($data[0] > 0) {
if ($data[0] > 0 && $uid != 1) {
return 1;
}
### Get data for auxillary checks.