Index: trunk/admin/category/permcacheupdate.php =================================================================== diff -u -r4446 -r4614 --- trunk/admin/category/permcacheupdate.php (.../permcacheupdate.php) (revision 4446) +++ trunk/admin/category/permcacheupdate.php (.../permcacheupdate.php) (revision 4614) @@ -174,11 +174,13 @@ // $this->SetStack($data); } } + function getDonePercent() { if(!$this->totalCats)return 0; return intval( round( $this->doneCats / $this->totalCats * 100 ) ); } + function getData() { $sql='SELECT data FROM '.$this->table; @@ -193,6 +195,7 @@ $this->Stack = & new clsRecursionStack(); } + function setData() { $tmp=Array @@ -207,9 +210,12 @@ $sql='INSERT '.$this->table.' SET data="'.addslashes(serialize($tmp)).'"'; $this->conn->Execute($sql); } + function initData() { - $sql='CREATE TABLE '.$this->table.'(data LONGTEXT)'; + $this->clearData(); // drop table before starting anyway + + $sql = 'CREATE TABLE '.$this->table.'(data LONGTEXT)'; $this->conn->Execute($sql); $sql='SELECT COUNT(*) as count FROM '.GetTablePrefix().'Category'; @@ -218,6 +224,7 @@ $this->doneCats=0; } + function clearData() { $sql='DROP TABLE IF EXISTS '.$this->table; @@ -277,6 +284,7 @@ return $this->Stack->Count() > 0; } } + function UpdateCachedPath(&$data) { $fields_hash = Array( 'CachedNavbar' => implode('>', $data['title']), @@ -347,10 +355,11 @@ function QueryPermissions(&$data) { + // don't search for section "view" permissions here :) $sql = sprintf('SELECT ipc.PermissionConfigId, ip.GroupId, ip.PermissionValue FROM '.GetTablePrefix().'Permissions AS ip LEFT JOIN '.GetTablePrefix().'PermissionConfig AS ipc ON ipc.PermissionName = ip.Permission - WHERE CatId = %s AND Permission LIKE "%%.VIEW"', + WHERE (CatId = %s) AND (Permission LIKE "%%.VIEW") AND (ipc.PermissionConfigId IS NOT NULL)', $data['current_id']); $rs = $this->conn->Execute($sql);