0; } /** * Retrieve all groups that have a privilege assigned * @param $strPriv (string) Privilege to test * @return array */ public static function privilegedGroups($strPriv) { $aReturn = array(); $h = db_query("SELECT act FROM privileges_assign WHERE privilege = $1 ". "ORDER BY act;", $strPriv); if(pg_num_rows($h) > 0) { while($a = pg_fetch_array($h)) { $aReturn[] = $a["act"]; } } return $aReturn; } /** * Determine if the current user is allowed to see and report errors. This * function tests if the user is member of a group which has the * mod-errorreporter_access privilege. * @return bool */ public static function userHasAccess() { if(erConfig::userIsAdmin() || !erConfig::privilegeAssigned("mod_errorreporter_access")) { // user is admin or privilege is not assigned return true; } else { return secure_privilege("mod_errorreporter_access"); } } /** * Determine if the current user has admin rights. This function tests if * the user is member of a group which has the * mod-errorreporter_access privilege * @return bool */ public static function userIsAdmin() { return secure_privilege("mod_errorreporter_admin"); } /** @} */ } ?>