public function onBeforeDispatch() { $result = parent::onBeforeDispatch(); if ($result) { // Load Akeeba Strapper include_once JPATH_ROOT . '/media/akeeba_strapper/strapper.php'; AkeebaStrapper::$tag = AKEEBAMEDIATAG; AkeebaStrapper::bootstrap(); AkeebaStrapper::jQueryUI(); AkeebaStrapper::addJSfile('media://com_akeeba/js/gui-helpers.js'); AkeebaStrapper::addJSfile('media://com_akeeba/js/akeebaui.js'); AkeebaStrapper::addJSfile('media://com_akeeba/js/piecon.min.js'); jimport('joomla.filesystem.file'); if (JFile::exists(F0FTemplateUtils::parsePath('media://com_akeeba/plugins/js/akeebaui.js', true))) { AkeebaStrapper::addJSfile('media://com_akeeba/plugins/js/akeebaui.js'); } AkeebaStrapper::addCSSfile('media://com_akeeba/theme/akeebaui.css'); // Control Check $view = F0FInflector::singularize($this->input->getCmd('view', $this->defaultView)); if ($view == 'liveupdate') { $url = JUri::base() . 'index.php?option=com_akeeba'; JFactory::getApplication()->redirect($url); return; } } return $result; }
public function onBeforeDispatch() { // You can't fix stupid… but you can try working around it if (!function_exists('json_encode') || !function_exists('json_decode')) { require_once JPATH_ADMINISTRATOR . '/components/' . $this->component . '/helpers/jsonlib.php'; } $result = parent::onBeforeDispatch(); if ($result) { // Merge the language overrides $paths = array(JPATH_ROOT, JPATH_ADMINISTRATOR); $jlang = JFactory::getLanguage(); $jlang->load($this->component, $paths[0], 'en-GB', true); $jlang->load($this->component, $paths[0], null, true); $jlang->load($this->component, $paths[1], 'en-GB', true); $jlang->load($this->component, $paths[1], null, true); $jlang->load($this->component . '.override', $paths[0], 'en-GB', true); $jlang->load($this->component . '.override', $paths[0], null, true); $jlang->load($this->component . '.override', $paths[1], 'en-GB', true); $jlang->load($this->component . '.override', $paths[1], null, true); // Load Akeeba Strapper if (!defined('AKEEBASUBSMEDIATAG')) { $staticFilesVersioningTag = md5(AKEEBASUBS_VERSION . AKEEBASUBS_DATE); define('AKEEBASUBSMEDIATAG', $staticFilesVersioningTag); } include_once JPATH_ROOT . '/media/akeeba_strapper/strapper.php'; AkeebaStrapper::$tag = AKEEBASUBSMEDIATAG; AkeebaStrapper::bootstrap(); AkeebaStrapper::jQueryUI(); AkeebaStrapper::addCSSfile('media://com_akeebasubs/css/backend.css'); AkeebaStrapper::addJSfile('media://com_akeebasubs/js/backend.js'); } return $result; }
public function onBeforeDispatch() { $result = parent::onBeforeDispatch(); if ($result) { // Clear com_modules and com_plugins cache (needed when we alter module/plugin state) $core_components = array('com_modules', 'com_plugins'); foreach ($core_components as $component) { try { $cache = JFactory::getCache($component); $cache->clean(); } catch (Exception $e) { // suck it up } } // Merge the language overrides $paths = array(JPATH_ROOT, JPATH_ADMINISTRATOR); $jlang = JFactory::getLanguage(); $jlang->load($this->component, $paths[0], 'en-GB', true); $jlang->load($this->component, $paths[0], null, true); $jlang->load($this->component, $paths[1], 'en-GB', true); $jlang->load($this->component, $paths[1], null, true); $jlang->load($this->component . '.override', $paths[0], 'en-GB', true); $jlang->load($this->component . '.override', $paths[0], null, true); $jlang->load($this->component . '.override', $paths[1], 'en-GB', true); $jlang->load($this->component . '.override', $paths[1], null, true); // Load Akeeba Strapper if (!defined('ADMINTOOLSMEDIATAG')) { $staticFilesVersioningTag = md5(ADMINTOOLS_VERSION . ADMINTOOLS_DATE); define('ADMINTOOLSMEDIATAG', $staticFilesVersioningTag); } include_once JPATH_ROOT . '/media/akeeba_strapper/strapper.php'; AkeebaStrapper::$tag = ADMINTOOLSMEDIATAG; AkeebaStrapper::bootstrap(); AkeebaStrapper::jQueryUI(); AkeebaStrapper::addCSSfile('admin://components/com_admintools/media/css/backend.css'); // Work around non-transparent proxy and reverse proxy IP issues if (class_exists('F0FUtilsIp', true)) { F0FUtilsIp::workaroundIPIssues(); } // Control Check $view = F0FInflector::singularize($this->input->getCmd('view', $this->defaultView)); if ($view == 'liveupdate') { $url = JUri::base() . 'index.php?option=com_admintools'; JFactory::getApplication()->redirect($url); return; } // ========== Master PW check ========== /** @var AdmintoolsModelMasterpw $model */ $model = F0FModel::getAnInstance('Masterpw', 'AdmintoolsModel'); if (!$model->accessAllowed($view)) { $url = $view == 'cpanel' ? 'index.php' : 'index.php?option=com_admintools&view=cpanel'; JFactory::getApplication()->redirect($url, JText::_('ATOOLS_ERR_NOTAUTHORIZED'), 'error'); return; } } return $result; }
public function onBeforeDispatch() { // You can't fix stupid… but you can try working around it if (!function_exists('json_encode') || !function_exists('json_decode')) { require_once JPATH_ADMINISTRATOR . '/components/' . $this->component . '/helpers/jsonlib.php'; } $result = parent::onBeforeDispatch(); if ($result) { // Merge the language overrides $paths = array(JPATH_ADMINISTRATOR, JPATH_ROOT); $jlang = JFactory::getLanguage(); $jlang->load($this->component, $paths[0], 'en-GB', true); $jlang->load($this->component, $paths[0], null, true); $jlang->load($this->component, $paths[1], 'en-GB', true); $jlang->load($this->component, $paths[1], null, true); $jlang->load($this->component . '.override', $paths[0], 'en-GB', true); $jlang->load($this->component . '.override', $paths[0], null, true); $jlang->load($this->component . '.override', $paths[1], 'en-GB', true); $jlang->load($this->component . '.override', $paths[1], null, true); // Load Akeeba Strapper if (!defined('AKEEBASUBSMEDIATAG')) { $staticFilesVersioningTag = md5(AKEEBASUBS_VERSION . AKEEBASUBS_DATE); define('AKEEBASUBSMEDIATAG', $staticFilesVersioningTag); } include_once JPATH_ROOT . '/media/akeeba_strapper/strapper.php'; AkeebaStrapper::$tag = AKEEBASUBSMEDIATAG; AkeebaStrapper::bootstrap(); AkeebaStrapper::jQueryUI(); AkeebaStrapper::addCSSfile('media://com_akeebasubs/css/frontend.css', AKEEBASUBS_VERSIONHASH); // Load helpers require_once JPATH_ADMINISTRATOR . '/components/com_akeebasubs/helpers/cparams.php'; // Default to the "levels" view $view = $this->input->getCmd('view', $this->defaultView); if (empty($view) || $view == 'cpanel') { $view = 'levels'; } // Set the view, if it's allowed $this->input->set('view', $view); if (!in_array(F0FInflector::pluralize($view), $this->allowedViews)) { $result = false; } // Handle the submitted form from the tax country module $taxCountry = JFactory::getApplication()->input->getCmd('mod_aktaxcountry_country', null); if (!is_null($taxCountry)) { JFactory::getSession()->set('country', $taxCountry, 'mod_aktaxcountry'); } } return $result; }
public function onBeforeDispatch() { $result = parent::onBeforeDispatch(); if ($result) { $strapperInclude = JPATH_ROOT . '/media/akeeba_strapper/strapper.php'; if (@file_exists($strapperInclude)) { @(include_once $strapperInclude); } if (class_exists('AkeebaStrapper')) { AkeebaStrapper::bootstrap(); AkeebaStrapper::jQueryUI(); } } return $result; }
public function onBeforeDispatch() { $result = parent::onBeforeDispatch(); if ($result) { // Load Akeeba Strapper include_once JPATH_ROOT . '/media/akeeba_strapper/strapper.php'; AkeebaStrapper::$tag = AKEEBAMEDIATAG; AkeebaStrapper::bootstrap(); AkeebaStrapper::jQueryUI(); AkeebaStrapper::addJSfile('media://com_akeeba/js/gui-helpers.js'); AkeebaStrapper::addJSfile('media://com_akeeba/js/akeebaui.js'); AkeebaStrapper::addJSfile('media://com_akeeba/plugins/js/akeebaui.js'); AkeebaStrapper::addCSSfile('media://com_akeeba/theme/akeebaui.css'); } return $result; }
public function onBeforeDispatch() { $result = parent::onBeforeDispatch(); if ($result) { // Load Akeeba Strapper include_once JPATH_ROOT . '/media/akeeba_strapper/strapper.php'; AkeebaStrapper::$tag = AKEEBAMEDIATAG; AkeebaStrapper::bootstrap(); AkeebaStrapper::jQueryUI(); AkeebaStrapper::addJSfile('media://com_akeeba/js/gui-helpers.js'); AkeebaStrapper::addJSfile('media://com_akeeba/js/akeebaui.js'); jimport('joomla.filesystem.file'); if (JFile::exists(FOFTemplateUtils::parsePath('media://com_akeeba/plugins/js/akeebaui.js', true))) { AkeebaStrapper::addJSfile('media://com_akeeba/plugins/js/akeebaui.js'); } AkeebaStrapper::addCSSfile('media://com_akeeba/theme/akeebaui.css'); } return $result; }
public function onBeforeDispatch() { $result = parent::onBeforeDispatch(); if ($result) { // Merge the language overrides $paths = array(JPATH_ADMINISTRATOR, JPATH_ROOT); $jlang = JFactory::getLanguage(); $jlang->load($this->component, $paths[0], 'en-GB', true); $jlang->load($this->component, $paths[0], null, true); $jlang->load($this->component, $paths[1], 'en-GB', true); $jlang->load($this->component, $paths[1], null, true); $jlang->load($this->component . '.override', $paths[0], 'en-GB', true); $jlang->load($this->component . '.override', $paths[0], null, true); $jlang->load($this->component . '.override', $paths[1], 'en-GB', true); $jlang->load($this->component . '.override', $paths[1], null, true); // Timezone fix; avoids errors printed out by PHP 5.3.3+ (thanks Yannick!) if (function_exists('date_default_timezone_get') && function_exists('date_default_timezone_set')) { if (function_exists('error_reporting')) { $oldLevel = error_reporting(0); } $serverTimezone = @date_default_timezone_get(); if (empty($serverTimezone) || !is_string($serverTimezone)) { $serverTimezone = 'UTC'; } if (function_exists('error_reporting')) { error_reporting($oldLevel); } @date_default_timezone_set($serverTimezone); } // Necessary defines for Akeeba Engine if (!defined('AKEEBAENGINE')) { define('AKEEBAENGINE', 1); // Required for accessing Akeeba Engine's factory class define('AKEEBAROOT', JPATH_ADMINISTRATOR . '/components/com_akeeba/akeeba'); } // I think I still use that stuff somewhere if (!defined('JPATH_COMPONENT_ADMINISTRATOR')) { define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/com_akeeba'); } // Make sure we have a profile set throughout the component's lifetime $session = JFactory::getSession(); $profile_id = $session->get('profile', null, 'akeeba'); if (is_null($profile_id)) { // No profile is set in the session; use default profile $session->set('profile', 1, 'akeeba'); } // Load Akeeba Engine require_once JPATH_COMPONENT_ADMINISTRATOR . '/engine/Factory.php'; Platform::addPlatform('joomla25', JPATH_COMPONENT_ADMINISTRATOR . '/platform/joomla25'); // Load the Akeeba Backup configuration and check user access permission $akeebaEngineConfig = Factory::getConfiguration(); Platform::getInstance()->load_configuration(); unset($akeebaEngineConfig); // Preload helpers require_once JPATH_ADMINISTRATOR . '/components/com_akeeba/helpers/includes.php'; require_once JPATH_ADMINISTRATOR . '/components/com_akeeba/helpers/escape.php'; // If JSON functions don't exist, load our compatibility layer if (!function_exists('json_encode') || !function_exists('json_decode')) { require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/jsonlib.php'; } // Load Akeeba Strapper include_once JPATH_ROOT . '/media/akeeba_strapper/strapper.php'; AkeebaStrapper::bootstrap(); } return $result; }