Index: branches/5.0.x/core/units/configuration/configuration_event_handler.php =================================================================== diff -u -N -r12734 -r12960 --- branches/5.0.x/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 12734) +++ branches/5.0.x/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 12960) @@ -1,6 +1,6 @@ Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { - $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; + return ; + } - // 1. save user selected module root category - $new_category_id = getArrayValue($items_info, 'ModuleRootCategory', 'VariableValue'); - if ($new_category_id !== false) { - unset($items_info['ModuleRootCategory']); - } + $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); - $object =& $event->getObject( Array('skip_autoload' => true) ); - /* @var $object kDBItem */ + // 1. save user selected module root category + $new_category_id = getArrayValue($items_info, 'ModuleRootCategory', 'VariableValue'); + if ($new_category_id !== false) { + unset($items_info['ModuleRootCategory']); + } - if ($items_info) { - $has_error = false; - foreach ($items_info as $id => $field_values) { - $object->Clear(); // clear validation errors from previous variable - $object->Load($id); - $object->SetFieldsFromHash($field_values); + $object =& $event->getObject( Array('skip_autoload' => true) ); + /* @var $object kDBItem */ - if (!$object->Update($id)) { - // don't stop when error found ! - $has_error = true; - } - } + if ($items_info) { + $has_error = false; + foreach ($items_info as $id => $field_values) { + $object->Clear(); // clear validation errors from previous variable + $object->Load($id); + $object->SetFieldsFromHash($field_values); - $event->status = $has_error ? erFAIL : erSUCCESS; + if (!$object->Update($id)) { + // don't stop when error found ! + $has_error = true; + } } - if ($event->status == erSUCCESS) { - if ($new_category_id !== false) { - // root category was submitted - $module = $this->Application->GetVar('module'); - $root_category_id = $this->Application->findModule('Name', $module, 'RootCat'); + $event->status = $has_error ? erFAIL : erSUCCESS; + } - if ($root_category_id != $new_category_id) { - // root category differs from one in db - $fields_hash = Array('RootCat' => $new_category_id); - $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Modules', 'Name = '.$this->Conn->qstr($module)); - } + if ($event->status == erSUCCESS) { + if ($new_category_id !== false) { + // root category was submitted + $module = $this->Application->GetVar('module'); + $root_category_id = $this->Application->findModule('Name', $module, 'RootCat'); + + if ($root_category_id != $new_category_id) { + // root category differs from one in db + $fields_hash = Array('RootCat' => $new_category_id); + $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Modules', 'Name = '.$this->Conn->qstr($module)); } + } - // reset cache - $changed = $this->Application->GetVar($event->getPrefixSpecial() . '_changed', Array ()); - $require_refresh = Array ( - 'AdvancedUserManagement', 'Site_Name', 'AdminConsoleInterface' - ); + // reset cache + $changed = $this->Application->GetVar($event->getPrefixSpecial() . '_changed', Array ()); + $require_refresh = Array ( + 'AdvancedUserManagement', 'Site_Name', 'AdminConsoleInterface' + ); - $refresh_sections = array_intersect($require_refresh, $changed); - $require_full_refresh = Array ('Site_Name', 'AdminConsoleInterface'); + $refresh_sections = array_intersect($require_refresh, $changed); + $require_full_refresh = Array ('Site_Name', 'AdminConsoleInterface'); - if (array_intersect($require_full_refresh, $changed)) { - $event->SetRedirectParam('refresh_all', 1); - } elseif ($refresh_sections) { - // reset sections too, because of AdvancedUserManagement - $event->SetRedirectParam('refresh_tree', 1); - } - - $this->Application->UnitConfigReader->ResetParsedData($refresh_sections ? true : false); + if (array_intersect($require_full_refresh, $changed)) { + $event->SetRedirectParam('refresh_all', 1); + } elseif ($refresh_sections) { + // reset sections too, because of AdvancedUserManagement + $event->SetRedirectParam('refresh_tree', 1); } - elseif ($this->Application->GetVar('errors_' . $event->getPrefixSpecial())) { - // because we have list out there, and this is item - $this->Application->removeObject( $event->getPrefixSpecial() ); - } + + $this->Application->UnitConfigReader->ResetParsedData($refresh_sections ? true : false); } + elseif ($this->Application->GetVar('errors_' . $event->getPrefixSpecial())) { + // because we have list out there, and this is item + $this->Application->removeObject( $event->getPrefixSpecial() ); + } // keeps module and section in REQUEST to ensure, that last admin template will work $event->SetRedirectParam('module', $this->Application->GetVar('module')); Index: branches/5.0.x/core/units/images/image_event_handler.php =================================================================== diff -u -N -r12734 -r12960 --- branches/5.0.x/core/units/images/image_event_handler.php (.../image_event_handler.php) (revision 12734) +++ branches/5.0.x/core/units/images/image_event_handler.php (.../image_event_handler.php) (revision 12960) @@ -1,6 +1,6 @@ Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; + return; + } + $event->status=erSUCCESS; $temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); Index: branches/5.0.x/core/units/modules/modules_event_handler.php =================================================================== diff -u -N -r12734 -r12960 --- branches/5.0.x/core/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 12734) +++ branches/5.0.x/core/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 12960) @@ -1,6 +1,6 @@ Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return ; } Index: branches/5.0.x/core/units/email_events/email_events_event_handler.php =================================================================== diff -u -N -r12734 -r12960 --- branches/5.0.x/core/units/email_events/email_events_event_handler.php (.../email_events_event_handler.php) (revision 12734) +++ branches/5.0.x/core/units/email_events/email_events_event_handler.php (.../email_events_event_handler.php) (revision 12960) @@ -1,6 +1,6 @@ Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; + return ; + } + $ids = implode(',', $this->StoreSelectedIDs($event)); $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); @@ -108,6 +113,11 @@ return ; } + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; + return ; + } + $items_info = $this->Application->GetVar('u'); if ($items_info) { $user_id = array_shift( array_keys($items_info) ); Index: branches/5.0.x/core/units/categories/categories_event_handler.php =================================================================== diff -u -N -r12896 -r12960 --- branches/5.0.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 12896) +++ branches/5.0.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 12960) @@ -1,6 +1,6 @@ Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } @@ -1104,6 +1105,7 @@ function OnPaste(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) || !$this->_checkPastePermission($event)) { + $event->status = erFAIL; return ; } @@ -1388,6 +1390,7 @@ } if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } @@ -2062,6 +2065,11 @@ */ function OnChangePriority(&$event) { + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; + return; + } + $object =& $event->getObject( Array('skip_autoload' => true) ); $ids = $this->StoreSelectedIDs($event); @@ -2106,6 +2114,11 @@ */ function OnRecalculatePriorities(&$event) { + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; + return; + } + $priority_helper =& $this->Application->recallObject('PriorityHelper'); /* @var $priority_helper kPriorityHelper */ Index: branches/5.0.x/core/units/users/users_event_handler.php =================================================================== diff -u -N -r12849 -r12960 --- branches/5.0.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 12849) +++ branches/5.0.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 12960) @@ -1,6 +1,6 @@ Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } - $event->status=erSUCCESS; $ids = $this->StoreSelectedIDs($event); $default_user_id = $this->Application->ConfigValue('DefaultSettingsUserId'); @@ -1593,6 +1593,7 @@ function OnMassCloneUsers(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } Index: branches/5.0.x/core/units/skins/skin_eh.php =================================================================== diff -u -N -r12734 -r12960 --- branches/5.0.x/core/units/skins/skin_eh.php (.../skin_eh.php) (revision 12734) +++ branches/5.0.x/core/units/skins/skin_eh.php (.../skin_eh.php) (revision 12960) @@ -1,6 +1,6 @@ Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } Index: branches/5.0.x/core/kernel/db/db_event_handler.php =================================================================== diff -u -N -r12955 -r12960 --- branches/5.0.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 12955) +++ branches/5.0.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 12960) @@ -1,6 +1,6 @@ Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } @@ -1300,6 +1301,7 @@ function OnMassDelete(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } @@ -1404,7 +1406,9 @@ } else { $this->Application->RemoveVar($changes_var_name); + $event->status = erFAIL; } + $this->clearSelectedIDs($event); $event->redirect_params = Array('opener' => 'u'); @@ -1670,6 +1674,7 @@ function iterateItems(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } @@ -1727,6 +1732,7 @@ function OnMassClone(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } Index: branches/5.0.x/core/units/themes/themes_eh.php =================================================================== diff -u -N -r12734 -r12960 --- branches/5.0.x/core/units/themes/themes_eh.php (.../themes_eh.php) (revision 12734) +++ branches/5.0.x/core/units/themes/themes_eh.php (.../themes_eh.php) (revision 12960) @@ -1,6 +1,6 @@ Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } Index: branches/5.0.x/core/kernel/db/cat_event_handler.php =================================================================== diff -u -N -r12952 -r12960 --- branches/5.0.x/core/kernel/db/cat_event_handler.php (.../cat_event_handler.php) (revision 12952) +++ branches/5.0.x/core/kernel/db/cat_event_handler.php (.../cat_event_handler.php) (revision 12960) @@ -1,6 +1,6 @@ Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) || !$this->_checkPastePermission($event)) { + $event->status = erFAIL; return; } @@ -291,6 +292,7 @@ function OnMassDelete(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } @@ -2419,6 +2421,7 @@ } if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } Index: branches/5.0.x/core/units/forms/forms_eh.php =================================================================== diff -u -N -r12734 -r12960 --- branches/5.0.x/core/units/forms/forms_eh.php (.../forms_eh.php) (revision 12734) +++ branches/5.0.x/core/units/forms/forms_eh.php (.../forms_eh.php) (revision 12960) @@ -1,6 +1,6 @@ Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "sections_parsed"'); - $this->Application->StoreVar('RefreshStructureTree', 1); + + if ($event->status == erSUCCESS) { + $this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "sections_parsed"'); + $this->Application->StoreVar('RefreshStructureTree', 1); + } } /** Index: branches/5.0.x/core/units/languages/languages_event_handler.php =================================================================== diff -u -N -r12734 -r12960 --- branches/5.0.x/core/units/languages/languages_event_handler.php (.../languages_event_handler.php) (revision 12734) +++ branches/5.0.x/core/units/languages/languages_event_handler.php (.../languages_event_handler.php) (revision 12960) @@ -1,6 +1,6 @@ Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } @@ -263,6 +264,7 @@ function OnImportLanguage(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } @@ -313,6 +315,7 @@ function OnExportLanguage(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; return; } @@ -408,6 +411,11 @@ */ function OnSynchronizeLanguages(&$event) { + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; + return; + } + // get language list with primary language first $sql = 'SELECT LanguageId FROM ' . TABLE_PREFIX . 'Language Index: branches/5.0.x/core/units/fck/fck_eh.php =================================================================== diff -u -N -r12734 -r12960 --- branches/5.0.x/core/units/fck/fck_eh.php (.../fck_eh.php) (revision 12734) +++ branches/5.0.x/core/units/fck/fck_eh.php (.../fck_eh.php) (revision 12960) @@ -1,6 +1,6 @@ "; - echo $res; - } + echo $res; + } - function OnRenameFile(&$event) { $event->status = erSTOP; + + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + return; + } + $old_name = $this->Application->GetVar('old_name'); $new_name = $this->Application->GetVar('new_name'); $folder = $this->Application->GetVar('folder'); @@ -117,6 +121,11 @@ function OnDeleteFiles(&$event) { $event->status = erSTOP; + + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + return; + } + $files = trim($this->Application->GetVar('files'),'|'); // echo $files; $a_files = explode('|', $files); @@ -150,6 +159,10 @@ { $event->status = erSTOP; + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + return; + } + $new_folder = $this->Application->GetVar('new_folder'); $current_folder = $this->Application->GetVar('current_folder'); $folderPath = WRITEABLE . '/user_files' . '/' . $current_folder . "/" . $new_folder; @@ -181,6 +194,11 @@ function OnUploadFile(&$event) { $event->status = erSTOP; + + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + return; + } + $fck_helper =& $this->Application->recallObject('FCKHelper'); /* @var fck_helper fckFCKHelper*/ $fck_helper->UploadFile(); Index: branches/5.0.x/core/units/config_search/config_search_event_handler.php =================================================================== diff -u -N -r12734 -r12960 --- branches/5.0.x/core/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 12734) +++ branches/5.0.x/core/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 12960) @@ -1,6 +1,6 @@ Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { - parent::OnUpdate($event); - - $conf_update = new kEvent('conf:OnUpdate'); - $conf_update->redirect = false; - $this->Application->HandleEvent($conf_update); + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $event->status = erFAIL; + return ; } + parent::OnUpdate($event); + + $conf_update = new kEvent('conf:OnUpdate'); + $conf_update->redirect = false; + $this->Application->HandleEvent($conf_update); + $event->SetRedirectParam('opener', 's'); // keeps module and section in REQUEST to ensure, that last admin template will work