[geeklog-cvs] geeklog-1.3/public_html/admin group.php,1.23,1.24
dhaun at geeklog.net
dhaun at geeklog.net
Fri Mar 21 12:15:23 EST 2003
Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin
In directory internal.geeklog.net:/tmp/cvs-serv31133
Modified Files:
group.php
Log Message:
Fixed bug #701596: Group permissions were displayed for the current user, not for the selected group.
Index: group.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/group.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** group.php 20 Sep 2002 20:54:15 -0000 1.23
--- group.php 21 Mar 2003 17:15:21 -0000 1.24
***************
*** 9,17 ****
// | |
// +---------------------------------------------------------------------------+
! // | Copyright (C) 2000,2001 by the following authors: |
// | |
! // | Authors: Tony Bibbs - tony at tonybibbs.com |
! // | Mark Limburg - mlimburg at users.sourceforge.net |
! // | Jason Wittenburg - jwhitten at securitygeeks.com |
// +---------------------------------------------------------------------------+
// | |
--- 9,18 ----
// | |
// +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2003 by the following authors: |
// | |
! // | Authors: Tony Bibbs - tony at tonybibbs.com |
! // | Mark Limburg - mlimburg at users.sourceforge.net |
! // | Jason Whittenburg - jwhitten at securitygeeks.com |
! // | Dirk Haun - dirk at haun-online.de |
// +---------------------------------------------------------------------------+
// | |
***************
*** 109,113 ****
// most topics should belong to the normal user group
$A['group_id'] = DB_getItem($_TABLES['groups'],'grp_id',"grp_name = 'Normal User'");
! $A['grp_gl_core'] == 0;
}
--- 110,114 ----
// most topics should belong to the normal user group
$A['group_id'] = DB_getItem($_TABLES['groups'],'grp_id',"grp_name = 'Normal User'");
! $A['grp_gl_core'] = 0;
}
***************
*** 201,207 ****
}
/**
! * Prints the features a group has access. Please follow the comments in the code
! * closely if you need to modify this function. Also right is synonymous with feature
*
* @param mixed $grp_id ID to print rights for
--- 202,260 ----
}
+
/**
! * Get the indirect features for a group, i.e. a list of all the features
! * that this group inherited from other groups.
! *
! * @param int $grp_id ID of group
! * @return string comma-separated list of feature names
! *
! */
! function getIndirectFeatures ($grp_id)
! {
! global $_TABLES;
!
! $checked = array ();
! $tocheck = array ($grp_id);
!
! do {
! $grp = array_pop ($tocheck);
!
! $result = DB_query ("SELECT ug_main_grp_id FROM {$_TABLES['group_assignments']} WHERE ug_grp_id = $grp AND ug_uid IS NULL");
! $numrows = DB_numRows ($result);
!
! $checked[] = $grp;
!
! for ($j = 0; $j < $numrows; $j++) {
! $A = DB_fetchArray ($result);
! if (!in_array ($A['ug_main_grp_id'], $checked) &&
! !in_array ($A['ug_main_grp_id'], $tocheck)) {
! $tocheck[] = $A['ug_main_grp_id'];
! }
! }
! }
! while (sizeof ($tocheck) > 0);
!
! // get features for all groups in $checked
! $glist = join (',', $checked);
! $result = DB_query("SELECT DISTINCT ft_name FROM {$_TABLES['access']},{$_TABLES['features']} WHERE ft_id = acc_ft_id AND acc_grp_id IN ($glist)");
! $nrows = DB_numRows ($result);
!
! $retval = '';
! for ($j = 1; $j <= $nrows; $j++) {
! $A = DB_fetchArray ($result);
! $retval .= $A['ft_name'];
! if ($j < $nrows) {
! $retval .= ',';
! }
! }
!
! return $retval;
! }
!
! /**
! * Prints the features a group has access. Please follow the comments in the
! * code closely if you need to modify this function. Also right is synonymous
! * with feature.
*
* @param mixed $grp_id ID to print rights for
***************
*** 213,218 ****
{
global $_TABLES, $VERBOSE, $_USER, $LANG_ACCESS;
!
! // this gets a bit complicated so bare with the comments
// first query for all available features
$features = DB_query("SELECT * FROM {$_TABLES['features']} ORDER BY ft_name");
--- 266,271 ----
{
global $_TABLES, $VERBOSE, $_USER, $LANG_ACCESS;
! $VERBOSE = true;
! // this gets a bit complicated so bear with the comments
// first query for all available features
$features = DB_query("SELECT * FROM {$_TABLES['features']} ORDER BY ft_name");
***************
*** 223,230 ****
$directfeatures = DB_query("SELECT acc_ft_id,ft_name FROM {$_TABLES['access']},{$_TABLES['features']} WHERE ft_id = acc_ft_id AND acc_grp_id = $grp_id",1);
! // now in many cases the features will be give to this user indirectly via membership
! // to another group. These are not editable and must, instead, be removed from that group
! // directly
! $indirectfeatures = SEC_getUserPermissions($grp_id);
$indirectfeatures = explode(',',$indirectfeatures);
--- 276,283 ----
$directfeatures = DB_query("SELECT acc_ft_id,ft_name FROM {$_TABLES['access']},{$_TABLES['features']} WHERE ft_id = acc_ft_id AND acc_grp_id = $grp_id",1);
! // now in many cases the features will be given to this user indirectly
! // via membership to another group. These are not editable and must,
! // instead, be removed from that group directly
! $indirectfeatures = getIndirectFeatures ($grp_id);
$indirectfeatures = explode(',',$indirectfeatures);
More information about the geeklog-cvs
mailing list