|
From: Benjamin C. <bc...@us...> - 2001-09-03 20:16:36
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv6688
Modified Files:
include.php
Log Message:
Query indenting, changed the group build_select to not include the user group (everyone has to be a user), and changed the owner build_select to only include developers
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- include.php 2001/09/03 17:36:07 1.49
+++ include.php 2001/09/03 20:16:34 1.50
@@ -126,9 +126,9 @@
// Grab group assignments and permissions based on groups
$q->query("select group_name, perm_name"
- ." from ".TBL_AUTH_PERM." ap, ".TBL_GROUP_PERM." gp, ".TBL_AUTH_GROUP." ag, ".TBL_USER_GROUP." ug"
- ." where ap.perm_id = gp.perm_id and gp.group_id = ag.group_id"
- ." and ag.group_id = ug.group_id and ug.user_id = {$u['user_id']}");
+ ." from ".TBL_AUTH_PERM." ap, ".TBL_GROUP_PERM." gp, ".TBL_AUTH_GROUP." ag, ".TBL_USER_GROUP." ug"
+ ." where ap.perm_id = gp.perm_id and gp.group_id = ag.group_id"
+ ." and ag.group_id = ug.group_id and ug.user_id = {$u['user_id']}");
while (list($group, $perm) = $q->grab()) {
$this->auth['perm'][$perm] = true;
$this->auth['group'][$group] = true;
@@ -151,7 +151,7 @@
global $auth;
// Administrators always pass
- if ($auth->auth[$auth_var]['admin']) {
+ if ($auth->auth[$auth_var]['Admin']) {
return true;
}
@@ -200,13 +200,13 @@
if ($u && $u != 'nobody') {
list($owner_open, $owner_closed) =
$q->grab("select sum(if(status_name in ('Unconfirmed','New','Assigned','Reopened'),1,0)),"
- ." sum(if(status_name not in ('Unconfirmed','New','Assigned','Reopened'),1,0))"
- ." from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id)"
- ." where assigned_to = $u");
+ ." sum(if(status_name not in ('Unconfirmed','New','Assigned','Reopened'),1,0))"
+ ." from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id)"
+ ." where assigned_to = $u");
list($reporter_open, $reporter_closed) =
- $q->grab("select sum(if(status_name in ('Unconfirmed','New','Assigned','Reopened'),1,0)),"
- ." sum(if(status_name not in ('Unconfirmed','New','Assigned','Reopened'),1,0))"
- ." from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id) where created_by = $u");
+ $q->grab("select sum(if(status_name in ('Unconfirmed','New','Assigned','Reopened'),1,0)),"
+ ." sum(if(status_name not in ('Unconfirmed','New','Assigned','Reopened'),1,0))"
+ ." from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id) where created_by = $u");
$this->set_var(array(
'loggedinas' => $auth->auth['uname'],
'liblock' => '',
@@ -281,7 +281,7 @@
$text = '';
$querystart = "select {$box}_id, {$box}_name from $cfgDatabase[$box]";
$queries = array(
- 'group' => $querystart.' order by group_name',
+ 'group' => $querystart.' where group_name <> "User" order by group_name',
'severity' => $querystart.' where sort_order > 0 order by sort_order',
'status' => $querystart.' where sort_order > 0 order by sort_order',
'resolution' => $querystart.' where sort_order > 0 order by sort_order',
@@ -294,7 +294,7 @@
case 'group' :
$q->query($queries[$box]);
while ($row = $q->grab()) {
- if ($value == $row[$box.'_id'] and $value != '') $sel = ' selected';
+ if (count($value) && in_array($row[$box.'_id'], $value)) $sel = ' selected';
else $sel = '';
$text .= '<option value="'.
$row[$box.'_id']."\"$sel>".$row[$box.'_name'].'</option>';
@@ -326,7 +326,7 @@
}
break;
case 'owner' :
- $q->query("select user_id, login from ".TBL_AUTH_USER." where active > 0 order by login");
+ $q->query("select u.user_id, login from ".TBL_AUTH_USER." u, ".TBL_USER_GROUP." ug, ".TBL_AUTH_GROUP." g where u.active > 0 and u.user_id = ug.user_id and ug.group_id = g.group_id and group_name = 'Developer' order by login");
while ($row = $q->grab()) {
if ($value == $row['user_id']) $sel = ' selected';
else $sel = '';
@@ -502,4 +502,4 @@
}
}
-?>
\ No newline at end of file
+?>
|