<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -55,69 +55,63 @@ class CORE_auth
 			$this-&gt;account = FORCE_SESS_ACCOUNT;
 			$this-&gt;logged  = TRUE;
 		} 
-
+        $this-&gt;auth_update();
 		if (  isset($VAR['_logout']) ||
 			  isset($VAR['_login'])  ||
 			  isset($VAR['lid'])     ||
 			  $force == true         ||
 			  CACHE_SESSIONS != &quot;1&quot;) {
-			$this-&gt;auth_update();
-			return;
-		} else {
-			if($this-&gt;session_auth_cache_retrieve())
-			{
-				$this-&gt;module_count = count($this-&gt;module);
-				return;
-			}
+        return;
+	} else {
+            if($this-&gt;session_auth_cache_retrieve())
+            {
+                $this-&gt;module_count = count($this-&gt;module);
+                return;
+            }
 		}
-		$this-&gt;auth_update();
 	}
 
 
 	function auth_update() {
-
-		if(!$this-&gt;account) {
-			$this-&gt;group = Array(&quot;0&quot;);
-			$this-&gt;module = Array(&quot;0&quot;);
-		} else {
-			$this-&gt;group_list($this-&gt;account); 
+	    $this-&gt;group = array('0');
+		$this-&gt;module = array('0');
+	    
+		if($this-&gt;account) {
+			$this-&gt;group_list($this-&gt;account);
 			if (!$this-&gt;group) {
-				$this-&gt;group = array ('0');
-				$this-&gt;module = array ('0');
 				return;
 			}
-		$db = &amp;DB();
-		$p = AGILE_DB_PREFIX;
-		$sql=&quot;SELECT DISTINCT MM.module_id, GM.method_id, GM.group_id,  
-			M.name AS module_name, M.parent_id AS module_parent_id, M.menu_display AS module_display, 
-			MM.name AS method_name, MM.page AS method_page, MM.menu_display AS method_display
-			FROM {$p}group_method as GM 
-			LEFT JOIN {$p}module as M on (GM.module_id=M.id and M.site_id=&quot;.DEFAULT_SITE.&quot;)
-			LEFT JOIN {$p}module_method as MM on (GM.method_id=MM.id and MM.site_id=&quot;.DEFAULT_SITE.&quot;) &quot;; 
-		for($i=0; $i&lt;count($this-&gt;group); $i++)
-		if($i==0) $sql .= &quot;WHERE (GM.group_id={$this-&gt;group[$i]} &quot;;
-		else      $sql .= &quot;OR GM.group_id={$this-&gt;group[$i]} &quot;; 
-		$sql .= &quot;) AND GM.site_id=&quot;.DEFAULT_SITE.&quot; ORDER BY M.name,MM.name&quot;;
-		$result=$db-&gt;Execute($sql); 
+    		$db = &amp;DB();
+    		$p = AGILE_DB_PREFIX;
+    		$sql=&quot;SELECT DISTINCT MM.module_id, GM.method_id, GM.group_id,  
+    			M.name AS module_name, M.parent_id AS module_parent_id, M.menu_display AS module_display, 
+    			MM.name AS method_name, MM.page AS method_page, MM.menu_display AS method_display
+    			FROM {$p}group_method as GM 
+    			LEFT JOIN {$p}module as M on (GM.module_id=M.id and M.site_id=&quot;.DEFAULT_SITE.&quot;)
+    			LEFT JOIN {$p}module_method as MM on (GM.method_id=MM.id and MM.site_id=&quot;.DEFAULT_SITE.&quot;) &quot;; 
+    		for($i=0; $i&lt;count($this-&gt;group); $i++)
+    		if($i==0) $sql .= &quot;WHERE (GM.group_id={$this-&gt;group[$i]} &quot;;
+    		else      $sql .= &quot;OR GM.group_id={$this-&gt;group[$i]} &quot;; 
+    		$sql .= &quot;) AND GM.site_id=&quot;.DEFAULT_SITE.&quot; ORDER BY M.name,MM.name&quot;;
+    		$result=$db-&gt;Execute($sql);
 			if($result === false)
 			{
 				global $C_debug;
 				$C_debug-&gt;error('core:auth.inc.php','auth_update', $db-&gt;ErrorMsg() . '&lt;br&gt;&lt;br&gt;' .$q);
-				return;        			
-			} 
+				return;
+			}
 			while (!$result-&gt;EOF) {
-
 				$module_name 	= $result-&gt;fields[&quot;module_name&quot;];
 				$method_name	= $result-&gt;fields[&quot;method_name&quot;];
 
 				if(empty($this-&gt;module[$module_name])) {        			
-					$this-&gt;module[$module_name] = 			  Array($result-&gt;fields[&quot;module_id&quot;],
+					$this-&gt;module[$module_name] = 			  array($result-&gt;fields[&quot;module_id&quot;],
 																	$result-&gt;fields[&quot;module_parent_id&quot;], 
 																	$result-&gt;fields[&quot;module_display&quot;]);
 				}
 
 				if(empty($this-&gt;module[$module_name][$method_name])) {
-					$this-&gt;module[$module_name][$method_name] = Array($result-&gt;fields[&quot;method_id&quot;],
+					$this-&gt;module[$module_name][$method_name] = array($result-&gt;fields[&quot;method_id&quot;],
 																	  $result-&gt;fields[&quot;method_display&quot;], 
 																	  $result-&gt;fields[&quot;method_page&quot;]);
 				} 
@@ -202,7 +196,7 @@ class CORE_auth
 			AND ( g.date_start IS NULL   OR g.date_start &lt;= $time ) 
 			AND ( g.date_expire IS NULL  OR g.date_expire = 0 OR g.date_expire &gt; $time ) 									
 			AND ag.active=1 AND g.status=1 
-			AND ag.site_id=&quot;.DEFAULT_SITE; 
+			AND ag.site_id=&quot;.DEFAULT_SITE;
 		$result = $db-&gt;Execute($q); 
 		if ($result === false) {
 			global $C_debug;
@@ -233,7 +227,7 @@ class CORE_auth
 					if($do) $this-&gt;group[] = $arr[$i][&quot;parent_id&quot;];
 				} 
 			}
-		}   
+		}
 		if($account != SESS_ACCOUNT) return $this-&gt;group;
 	} 
 
@@ -286,4 +280,4 @@ class CORE_auth
 		return auth_generate_admin_menu($this);
 	}
 }
-?&gt;
+?&gt;
\ No newline at end of file</diff>
      <filename>modules/core/auth.inc.php</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@
 function auth_generate_admin_menu($menu_obj)
 {                   
 	$menu_obj-&gt;auth_update();
-	global $C_translate, $smarty, $C_list;                    
+	global $C_translate, $smarty, $C_list;
 
 	$i=1;
 	$js='';</diff>
      <filename>modules/core/auth_generate_admin_menu.inc.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7bda76a3e4aeecf21449816311b198130b731fcd</id>
    </parent>
  </parents>
  <author>
    <name>Scott Luther</name>
    <email>sluther@bitpiston.com</email>
  </author>
  <url>http://github.com/tony-landis/agilebill/commit/9b1628149c2ab0a8b7ad6cef8f5954231a604f41</url>
  <id>9b1628149c2ab0a8b7ad6cef8f5954231a604f41</id>
  <committed-date>2009-03-10T15:49:42-07:00</committed-date>
  <authored-date>2009-02-22T05:11:12-08:00</authored-date>
  <message>* Updated auth.inc.php</message>
  <tree>5714f87a3c6a5469d1d0b5b4c9680d4b13237a08</tree>
  <committer>
    <name>Scott Luther</name>
    <email>sluther@bitpiston.com</email>
  </committer>
</commit>
