Esempio n. 1
0
 public function onBeforeBrowse()
 {
     $result = parent::onBeforeBrowse();
     if ($result) {
         $params = JComponentHelper::getParams('com_akeeba');
         $model = $this->getThisModel();
         $view = $this->getThisView();
         /** @var AkeebaModelCpanels $model */
         $view->setModel($model);
         $aeconfig = AEFactory::getConfiguration();
         // Invalidate stale backups
         AECoreKettenrad::reset(array('global' => true, 'log' => false, 'maxrun' => $params->get('failure_timeout', 180)));
         // Just in case the reset() loaded a stale configuration...
         AEPlatform::getInstance()->load_configuration();
         // Let's make sure the temporary and output directories are set correctly and writable...
         $wizmodel = FOFModel::getAnInstance('Confwiz', 'AkeebaModel');
         $wizmodel->autofixDirectories();
         // Check if we need to toggle the settings encryption feature
         $model->checkSettingsEncryption();
         // Update the magic component parameters
         $model->updateMagicParameters();
         // Run the automatic database check
         $model->checkAndFixDatabase();
         // Run the automatic update site refresh
         $model->refreshUpdateSite();
         // Check the last installed version
         $versionLast = null;
         if (file_exists(JPATH_COMPONENT_ADMINISTRATOR . '/akeeba.lastversion.php')) {
             include_once JPATH_COMPONENT_ADMINISTRATOR . '/akeeba.lastversion.php';
             if (defined('AKEEBA_LASTVERSIONCHECK')) {
                 $versionLast = AKEEBA_LASTVERSIONCHECK;
             }
         }
         if (is_null($versionLast)) {
             $component = JComponentHelper::getComponent('com_akeeba');
             if (is_object($component->params) && $component->params instanceof JRegistry) {
                 $params = $component->params;
             } else {
                 $params = new JParameter($component->params);
             }
             $versionLast = $params->get('lastversion', '');
         }
         if (version_compare(AKEEBA_VERSION, $versionLast, 'ne') || empty($versionLast)) {
             $this->setRedirect('index.php?option=com_akeeba&view=postsetup');
             return true;
         }
     }
     return $result;
 }
Esempio n. 2
0
 protected function onBeforeBrowse()
 {
     $result = parent::onBeforeBrowse();
     if ($result) {
         require_once JPATH_ADMINISTRATOR . '/components/com_zlmanager/helpers/extensions.php';
         $exts = ZLManagerExtensionsHelper::getExtensionsAndVersions();
         $view = $this->getThisView();
         $view->assign('jextensions', $exts['extensions']);
         $view->assign('versions', $exts['versions']);
     }
     return $result;
 }