|
From: Benjamin C. <bc...@us...> - 2001-11-14 14:28:09
|
Update of /cvsroot/phpbt/phpbt/inc
In directory usw-pr-cvs1:/tmp/cvs-serv7707/inc
Modified Files:
auth.php
Log Message:
Code cleanup
Index: auth.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/inc/auth.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- auth.php 2001/11/13 03:48:38 1.1
+++ auth.php 2001/11/14 14:28:06 1.2
@@ -43,7 +43,7 @@
}
function is_authenticated() {
- if ($this->auth['uid'] &&
+ if (isset($this->auth['uid']) && $this->auth['uid'] &&
($this->lifetime <= 0 || time() < $this->auth['exp'])) {
return $this->auth['uid'];
} else {
@@ -81,10 +81,10 @@
function unauth() {
$this->auth['uid'] = 0;
- $this->auth['perm'] = '';
+ $this->auth['perm'] = array();
$this->auth['exp'] = 0;
- $this->auth['group'] = '';
- $this->auth['db_fields'] = '';
+ $this->auth['group'] = array();
+ $this->auth['db_fields'] = array();
}
}
@@ -108,18 +108,18 @@
global $auth;
// Administrators always pass
- if ($auth->auth[$auth_var]['Admin']) {
+ if (isset($auth->auth[$auth_var]['Admin'])) {
return true;
}
if (is_array($reqs)) {
foreach ($reqs as $req) {
- if (!$auth->auth[$auth_var][$req]) {
+ if (!isset($auth->auth[$auth_var][$req])) {
return false;
}
}
} else {
- if (!$auth->auth[$auth_var][$reqs]) {
+ if (!isset($auth->auth[$auth_var][$reqs])) {
return false;
}
}
|