|
From: Benjamin C. <bc...@us...> - 2002-03-27 20:48:38
|
Update of /cvsroot/phpbt/phpbt/inc
In directory usw-pr-cvs1:/tmp/cvs-serv21632/inc
Modified Files:
auth.php
Log Message:
Fixing namespace collision problem with global and session vars
Index: auth.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/inc/auth.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- auth.php 27 Mar 2002 17:52:09 -0000 1.12
+++ auth.php 27 Mar 2002 20:48:32 -0000 1.13
@@ -89,7 +89,7 @@
TBL_GROUP_PERM." gp where group_id in (".
delimit_list(',', $HTTP_SESSION_VARS['group_ids']).") and gp.perm_id = ap.perm_id");
foreach ($perms as $perm) {
- $HTTP_SESSION_VARS['perm'][$perm] = true;
+ $HTTP_SESSION_VARS['perms'][$perm] = true;
}
$HTTP_SESSION_VARS['uid'] = $u['user_id'];
@@ -101,7 +101,7 @@
global $HTTP_SESSION_VARS;
$HTTP_SESSION_VARS['uid'] = 0;
- $HTTP_SESSION_VARS['perm'] = array();
+ $HTTP_SESSION_VARS['perms'] = array();
$HTTP_SESSION_VARS['exp'] = 0;
$HTTP_SESSION_VARS['group'] = array();
$HTTP_SESSION_VARS['group_ids'] = array(0);
@@ -117,10 +117,10 @@
global $HTTP_SESSION_VARS;
if (!$this->have_perm($p)) {
- if (!isset($HTTP_SESSION_VARS['perm']) ) {
- $HTTP_SESSION_VARS['perm'] = '';
+ if (!isset($HTTP_SESSION_VARS['perms']) ) {
+ $HTTP_SESSION_VARS['perms'] = '';
}
- $this->perm_invalid($HTTP_SESSION_VARS['perm'], $p);
+ $this->perm_invalid($HTTP_SESSION_VARS['perms'], $p);
exit();
}
}
@@ -156,12 +156,12 @@
function have_perm($req_perms) {
- return $this->check_auth('perm', $req_perms);
+ return $this->check_auth('perms', $req_perms);
}
- function perm_invalid() {
- global $t, $HTTP_SESSION_VARS;
+ function perm_invalid($actual_perms, $required_perms) {
+ global $t;
$t->set_file('content','badperm.html');
$t->pparse('main',array('content','wrap','main'));
|