/** * Determines if user belongs to specified group * * This is part of the Geeklog security implementation. This function * looks up whether a user belongs to a specified group * * @grp_to_verify string Group we want to see if user belongs to * @uid string ID for user to check * @cur_grp_id string Current group we are working with in hierarchy * */ function SEC_inGroup($grp_to_verify,$uid='',$cur_grp_id='') { global $_TABLES, $_USER, $_SEC_VERBOSE, $_GROUPS; if (empty($uid)) { if (empty($_USER['uid'])) { $uid = 1; } else { $uid = $_USER['uid']; } } // I for sme reason $_GROUPS is empty here, populate it // 9 times out of 10 $_GROUPS will already exist if (empty($_GROUPS)) { $_GROUPS = SEC_getUserGroups($_USER['uid']); } if (is_numeric($grp_to_verify)) { if (in_array($grp_to_verify, $_GROUPS)) { return true; } else { return false; } } else { if (!empty($_GROUPS[$grp_to_verify])) { return true; } else { return false; } } }