X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FInvoke.php;h=e1fe43347cacaaaec56294fc6ee905f3e4cfa671;hb=b5a104e41f5250de860b532494fd869cbc5a61d5;hp=2bbf3581722d2d4669fb4915df284b352dc1e5aa;hpb=6e46589da472f166ecc1b3c5f9182e3d9f3dbadd;p=civicrm-core.git diff --git a/CRM/Core/Invoke.php b/CRM/Core/Invoke.php index 2bbf358172..e1fe43347c 100644 --- a/CRM/Core/Invoke.php +++ b/CRM/Core/Invoke.php @@ -1,7 +1,7 @@ getErrorData(); + $message = $e->getMessage(); + if (isset($params['legacy_status_bounce'])) { + //@todo remove this- see comments on + //https://github.com/eileenmcnaughton/civicrm-core/commit/ae686b09e2c987091612bb25ba0a58e520a203e7 + CRM_Core_Error::statusBounce($params['message']); + } + else { + $session = CRM_Core_Session::singleton(); + $session->setStatus( + $message, + CRM_Utils_Array::value('message_title', $params), + CRM_Utils_Array::value('message_type', $params, 'error') + ); + + // @todo remove this code - legacy redirect path is an interim measure for moving redirects out of BAO + // to somewhere slightly more acceptable. they should not be part of the exception class & should + // be managed @ the form level - if you find a form that is triggering this piece of code + // you should log a ticket for it to be removed with details about the form you were on. + if(!empty($params['legacy_redirect_path'])) { + if(CRM_Utils_System::isDevelopment()) { + // here we could set a message telling devs to log it per above + } + CRM_Utils_System::redirect($params['legacy_redirect_path'], $params['legacy_redirect_query']); + } + } + } + catch (Exception $e) { // Recall: CRM_Core_Config is initialized before calling CRM_Core_Invoke $config = CRM_Core_Config::singleton(); return CRM_Core_Error::handleUnhandledException($e); @@ -119,7 +150,7 @@ class CRM_Core_Invoke { static public function init($args) { // first fire up IDS and check for bad stuff $config = CRM_Core_Config::singleton(); - if ($config->useIDS) { + if (!CRM_Core_Permission::check('skip IDS check')) { $ids = new CRM_Core_IDS(); $ids->check($args); } @@ -425,8 +456,13 @@ class CRM_Core_Invoke { } } - $page = new CRM_Profile_Page_Listings(); - return $page->run(); + if ($secondArg == 'view' || empty($secondArg)) { + $page = new CRM_Profile_Page_Listings(); + return $page->run(); + } + + CRM_Utils_System::permissionDenied(); + return; } /** @@ -458,7 +494,10 @@ class CRM_Core_Invoke { // also cleanup module permissions $config->cleanupPermissions(); - CRM_Core_BAO_SETTING::updateSettingsFromMetaData(); + // also rebuild word replacement cache + CRM_Core_BAO_WordReplacement::rebuild(); + + CRM_Core_BAO_Setting::updateSettingsFromMetaData(); CRM_Core_Resources::singleton()->resetCacheCode(); // also rebuild triggers if requested explicitly @@ -468,7 +507,7 @@ class CRM_Core_Invoke { ) { CRM_Core_DAO::triggerRebuild(); } - + CRM_Core_DAO_AllCoreTables::reinitializeCache(TRUE); CRM_Core_ManagedEntities::singleton(TRUE)->reconcile(); } }