|
From: Benjamin C. <bc...@us...> - 2002-03-14 19:36:07
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv30101
Modified Files:
include.php
Log Message:
Hopefully the last fix for project restrictions
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- include.php 13 Mar 2002 17:44:02 -0000 1.97
+++ include.php 14 Mar 2002 19:36:00 -0000 1.98
@@ -252,10 +252,13 @@
// Check to see if we have projects that shouldn't be visible to the user
$restricted_projects = '0';
if (!$perm->have_perm('Admin')) {
+ $viewable_projects = delimit_list(',',
+ $q->grab_field_set("select project_id from ".TBL_PROJECT_GROUP.
+ " where group_id in (".delimit_list(',', $auth->auth['group_ids']).")"));
+ $viewable_projects = $viewable_projects ? $viewable_projects : '0';
$matching_projects = delimit_list(',',
$q->grab_field_set("select project_id from ".TBL_PROJECT_GROUP.
- " where group_id not in (".delimit_list(',', $auth->auth['group_ids']).
- ") group by project_id"));
+ " where project_id not in ($viewable_projects) group by project_id"));
if ($matching_projects) {
$restricted_projects .= ",$matching_projects";
}
|