|
From: Ulf E. <ulf...@us...> - 2005-10-02 20:45:29
|
Update of /cvsroot/phpbt/phpbt/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29096/inc Modified Files: auth.php Log Message: project admin permissions Index: auth.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/auth.php,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- auth.php 1 Oct 2005 15:19:55 -0000 1.24 +++ auth.php 2 Oct 2005 20:45:21 -0000 1.25 @@ -104,9 +104,9 @@ var $classname = 'uperm'; var $permissions = array (); - function check($p) { + function check($p, $proj = 0) { - if (!$this->have_perm($p)) { + if (!$this->have_perm($p, $proj)) { if (!isset($_SESSION['perms']) ) { $_SESSION['perms'] = ''; } @@ -148,13 +148,17 @@ } } - function check_auth($auth_var, $reqs) { + function check_auth($auth_var, $reqs, $proj = 0) { // Administrators always pass if (@isset($_SESSION[$auth_var]['Admin'])) { return true; } + if (isset($proj) && !empty($proj) && $this->have_perm_proj($proj)) { + return true; + } + if (is_array($reqs)) { foreach ($reqs as $req) { if (!@isset($_SESSION[$auth_var][$req])) { @@ -177,8 +181,8 @@ } - function have_perm($req_perms) { - return $this->check_auth('perms', $req_perms); + function have_perm($req_perms, $proj = 0) { + return $this->check_auth('perms', $req_perms, $proj); } |