Index: branches/5.1.x/core/units/admin/admin_events_handler.php =================================================================== diff -u -r12657 -r13086 --- branches/5.1.x/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 12657) +++ branches/5.1.x/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 13086) @@ -1,6 +1,6 @@ Name, $system_events)) { @@ -71,7 +71,7 @@ } if ($event->Name == 'OnSaveMenuFrameWidth') { - $perm_value = $this->Application->IsAdmin() && $this->Application->LoggedIn(); + $perm_value = $this->Application->isAdminUser; } if (isset($perm_value)) { @@ -98,15 +98,6 @@ $this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName LIKE "mod_rw%"'); } - function OnResetCMSMenuCache(&$event) - { - if ($this->Application->GetVar('ajax') == 'yes') { - $event->status = erSTOP; - } - - $this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName IN ("cms_menu", "StructureTree")'); - } - function OnResetSections(&$event) { if ($this->Application->GetVar('ajax') == 'yes') { @@ -134,6 +125,11 @@ WHERE VarName IN("config_files", "configs_parsed", "sections_parsed")'; $this->Conn->Query($sql); + $skin_helper =& $this->Application->recallObject('SkinHelper'); + /* @var $skin_helper SkinHelper */ + + $skin_helper->deleteCompiled(); + if (isset($this->Application->Memcached)) { $this->Application->Memcached->delete('master:config_files'); $this->Application->Memcached->delete('master:configs_parsed'); @@ -455,8 +451,10 @@ } $prefix_elems = split('\.|_', $prefix_special, 2); $perm_sections = $this->Application->getUnitOption($prefix_elems[0], 'PermSection'); + if(!$this->Application->CheckPermission($perm_sections['main'].'.view')) { - $this->Application->Redirect('no_permission'); + $event->status = erPERM_FAIL; + return ; } $export_helper->PrefixSpecial = $prefix_special; @@ -480,7 +478,8 @@ $perm_sections = $this->Application->getUnitOption($prefix_elems[0], 'PermSection'); if(!$this->Application->CheckPermission($perm_sections['main'].'.view')) { - $this->Application->Redirect('no_permission'); + $event->status = erPERM_FAIL; + return ; } $export_helper->GetCSV(); @@ -498,7 +497,8 @@ $perm_sections = $this->Application->getUnitOption($prefix_elems[0], 'PermSection'); if(!$this->Application->CheckPermission($perm_sections['main'].'.add') && !$this->Application->CheckPermission($perm_sections['main'].'.edit')) { - $this->Application->Redirect('no_permission'); + $event->status = erPERM_FAIL; + return ; } $object =& $event->getObject( Array('skip_autoload' => true) ); @@ -542,7 +542,8 @@ $prefix_elems = split('\.|_', $prefix_special, 2); $perm_sections = $this->Application->getUnitOption($prefix_elems[0], 'PermSection'); if(!$this->Application->CheckPermission($perm_sections['main'].'.add') && !$this->Application->CheckPermission($perm_sections['main'].'.edit')) { - $this->Application->Redirect('no_permission'); + $event->status = erPERM_FAIL; + return ; } $import_helper->ImportStep(); @@ -815,15 +816,15 @@ foreach ($a_fields AS $field_name) { $fields_sql .= '`'.$field_name.'`,'; } - $fields_sql = preg_replace('/(.*),$/', '\\1', $fields_sql); + $fields_sql = substr($fields_sql, 0, -1); $temp = ''; foreach ($a_data AS $a_row) { $values_sql = ''; foreach ($a_row as $field_name => $field_value) { $values_sql .= $this->Conn->qstr($field_value).','; } - $values_sql = preg_replace('/(.*),$/', '\\1', $values_sql); + $values_sql = substr($values_sql, 0, -1); $sql = 'INSERT INTO '.$table.' ('.$fields_sql.') VALUES ('.$values_sql.');'; $sql = str_replace("\n", "\\n", $sql); $sql = str_replace("\r", "\\r", $sql);