|
From: Benjamin C. <bc...@us...> - 2002-03-11 16:17:58
|
Update of /cvsroot/phpbt/phpbt/inc
In directory usw-pr-cvs1:/tmp/cvs-serv6213/inc
Modified Files:
auth.php
Log Message:
Fixed a bug with the assigning of groups upon login
Index: auth.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/inc/auth.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- auth.php 2 Mar 2002 18:47:16 -0000 1.8
+++ auth.php 11 Mar 2002 16:17:54 -0000 1.9
@@ -76,10 +76,12 @@
$this->auth['db_fields'] = @unserialize($u['bug_list_fields']);
// Grab group assignments and permissions based on groups
- $this->auth['group_ids'] = $q->grab_field_set("select group_id from ".
- TBL_USER_GROUP." where user_id = {$u['user_id']}");
- foreach ($this->auth['group_ids'] as $group) {
- $this->auth['group'][$group] = true;
+ $q->query("select u.group_id, group_name from ".TBL_USER_GROUP." u, ".
+ TBL_AUTH_GROUP." a where user_id = {$u['user_id']} ".
+ 'and u.group_id = a.group_id');
+ while (list($groupid, $groupname) = $q->grab()) {
+ $this->auth['group_ids'][] = $groupid;
+ $this->auth['group'][$groupname] = true;
}
$q->query("select perm_name from ".TBL_AUTH_PERM." ap, ".
TBL_GROUP_PERM." gp where group_id in (".
|