|
From: Ulf E. <ulf...@us...> - 2005-08-27 13:14:44
|
Update of /cvsroot/phpbt/phpbt/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29692/phpbt/inc Modified Files: auth.php functions.php Log Message: Various permission related fixes. Index: auth.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/auth.php,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- auth.php 4 Jun 2005 18:56:55 -0000 1.21 +++ auth.php 27 Aug 2005 13:14:28 -0000 1.22 @@ -126,13 +126,21 @@ } } - function have_perm_proj($project_id) { + function have_perm_proj($project_id = -1) { global $db; if ($this->have_perm('Admin')) { return true; } + if ($project_id == -1) { + if ( $db->getCol('SELECT user_id FROM '.TBL_PROJECT_PERM.' WHERE user_id = '.$_SESSION['uid']) ) { + return true; + } else { + return false; + } + } + if ( $db->getCol('SELECT user_id FROM '.TBL_PROJECT_PERM.' WHERE user_id = '.$_SESSION['uid']." AND project_id = $project_id") ) { return true; } else { Index: functions.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/functions.php,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- functions.php 22 Aug 2005 20:54:43 -0000 1.61 +++ functions.php 27 Aug 2005 13:14:28 -0000 1.62 @@ -308,6 +308,7 @@ global $db; switch($var) { + case 'reporter' : case 'assigned_to' : return maskemail($db->getOne("select login from ".TBL_AUTH_USER." where user_id = ".$db->quote($val))); break; @@ -318,7 +319,7 @@ /// /// Divide the results of a database query into multiple pages function multipages($nr, $page, $urlstr) { - global $me, $selrange, $t, $u, $db, $perm; + global $me, $selrange, $t, $u, $db, $perm, $auth; $pages = ''; if (!$page) $page = 1; @@ -327,7 +328,7 @@ $llimit = 0; $page = 0; } else { - if ($perm->check_auth('group', 'Users')) + if ($auth->is_authenticated()) $selrange = $db->getOne('select def_results from '.TBL_USER_PREF.' where user_id = '.$db->quote($u)); $llimit = ($page-1)*$selrange; } |