* Updated auth.inc.php

This commit is contained in:
Scott Luther 2009-02-22 05:11:12 -08:00
parent 7bda76a3e4
commit 9b1628149c
2 changed files with 34 additions and 40 deletions

View File

@ -55,13 +55,12 @@ class CORE_auth
$this->account = FORCE_SESS_ACCOUNT; $this->account = FORCE_SESS_ACCOUNT;
$this->logged = TRUE; $this->logged = TRUE;
} }
$this->auth_update();
if ( isset($VAR['_logout']) || if ( isset($VAR['_logout']) ||
isset($VAR['_login']) || isset($VAR['_login']) ||
isset($VAR['lid']) || isset($VAR['lid']) ||
$force == true || $force == true ||
CACHE_SESSIONS != "1") { CACHE_SESSIONS != "1") {
$this->auth_update();
return; return;
} else { } else {
if($this->session_auth_cache_retrieve()) if($this->session_auth_cache_retrieve())
@ -70,20 +69,16 @@ class CORE_auth
return; return;
} }
} }
$this->auth_update();
} }
function auth_update() { function auth_update() {
$this->group = array('0');
$this->module = array('0');
if(!$this->account) { if($this->account) {
$this->group = Array("0");
$this->module = Array("0");
} else {
$this->group_list($this->account); $this->group_list($this->account);
if (!$this->group) { if (!$this->group) {
$this->group = array ('0');
$this->module = array ('0');
return; return;
} }
$db = &DB(); $db = &DB();
@ -106,18 +101,17 @@ class CORE_auth
return; return;
} }
while (!$result->EOF) { while (!$result->EOF) {
$module_name = $result->fields["module_name"]; $module_name = $result->fields["module_name"];
$method_name = $result->fields["method_name"]; $method_name = $result->fields["method_name"];
if(empty($this->module[$module_name])) { if(empty($this->module[$module_name])) {
$this->module[$module_name] = Array($result->fields["module_id"], $this->module[$module_name] = array($result->fields["module_id"],
$result->fields["module_parent_id"], $result->fields["module_parent_id"],
$result->fields["module_display"]); $result->fields["module_display"]);
} }
if(empty($this->module[$module_name][$method_name])) { if(empty($this->module[$module_name][$method_name])) {
$this->module[$module_name][$method_name] = Array($result->fields["method_id"], $this->module[$module_name][$method_name] = array($result->fields["method_id"],
$result->fields["method_display"], $result->fields["method_display"],
$result->fields["method_page"]); $result->fields["method_page"]);
} }