if (!$oSecurityManager->initialize() || !$ogSecurityManager->initialize()) { _throw("FNoSecurityTables", "There are no security tables \"{$fusebox['tableGroups']}\" and/or \"{$fusebox['tableSecurity']}\" present in DB"); } // checking that default user group exists and add it if needed if (!$oSecurityManager->checkGroup($fusebox['defaultGroup'])) { $tmpoGroup = new Group(0, $fusebox['defaultGroup']); if ($oSecurityManager->addGroup($tmpoGroup)) { unset($tmpoGroup); } else { _throw("FCannotAddDefaultGroup", "Cannot add default security group"); } } // check if user is default user then make him belong to default group only if ($defaultGroup = $oSecurityManager->getGroup($fusebox['defaultGroup'])) { if ($oUser->isDefaultUser()) { if (!$oSecurityManager->setUserGroups(array($defaultGroup))) { _throw("FCannotSetDefaultGroupToDefaultUser", "Cannot make default user belong to default group"); } } } else { _throw("FNoDefaultGroup", "No default group present"); } // checking if default registrant groups exists and add if needed if (strlen($fusebox['defaultRegistrantGroups']) > 0) { $tmparrRegistrantGroups = explode(",", $fusebox['defaultRegistrantGroups']); if (count($tmparrRegistrantGroups) > 0) { foreach ($tmparrRegistrantGroups as $g) { if (!$oSecurityManager->checkGroup($g)) { $tmpoGroup = new Group(0, $g); if ($oSecurityManager->addGroup($tmpoGroup)) { unset($tmpoGroup);