[Phpslash-commit] CVS: phpslash-ft/class functions.inc,1.101,1.102
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2002-05-23 18:42:02
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory usw-pr-cvs1:/tmp/cvs-serv24043/phpslash-ft/class Modified Files: functions.inc Log Message: Permission Groups Index: functions.inc =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/functions.inc,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** functions.inc 29 Apr 2002 20:52:49 -0000 1.101 --- functions.inc 23 May 2002 18:41:59 -0000 1.102 *************** *** 1053,1056 **** --- 1053,1115 ---- } + /** + * function pslgetAllPerms returns an array of all perms/groups + * + * @access public + * + * @return array perms_ary + */ + function pslgetAllPerms() { + + global $_PSL; + + $db = new slashDB; + + if (empty($_PSL['perm_array'])) { + // static $_PSL['perm_array']; + // debug("pslgetAllPerms", "groups"); + + $q = "SELECT group_name, + group_id + FROM psl_group + ORDER BY group_name"; + $db->query($q); + + while ($db->next_record()) { + $perm_name = $db->f("group_name"); + $_PSL['perm_array'][$perm_name] = $db->f("group_id"); + } + /* + debug("pslgetAllPerms", "sections"); + $q = "SELECT section_id + FROM psl_section + ORDER BY section_name"; + $db->query($q); + */ /* + while ($db->next_record()) { + $perm_name = $db->f("section_id"); + $_PSL['perm_array'][$perm_name] = true; + } + + debug("pslgetAllPerms", "perms"); + $q = "SELECT permission_name + FROM psl_permission + ORDER BY permission_name"; + $db->query($q); + + while ($db->next_record()) { + $perm_name = $db->f("permission_name"); + $_PSL['perm_array'][$perm_name] = true; + } + */ + // debug("pslgetAllPerms::_PSL['perm_array']", $_PSL['perm_array']); + // $sess->register(_PSL['perm_array']); + } else { + // debug("pslgetAllPerms", "already exists"); + } + // debug("pslgetAllPerms::_PSL['perm_array']", $_PSL['perm_array']); + return $_PSL['perm_array']; + } + ?> |