Пример #1
0
 /**
  * wird ausgeführt, wenn wenn Benutzer in Modulmanager auf "Modul konfigurieren" klickt
  * @param string $module
  * @return boolean
  */
 public function run($module = null)
 {
     if (!in_array($module, $this->activeModules)) {
         trigger_error("Request for acpConfig event of disabled module '{$module}'!");
         $view = new \fpcm\model\view\error();
         $view->setMessage("The module '{$module}' is not enabled for execution!");
         $view->render();
         die;
     }
     $className = \fpcm\model\abstracts\module::getModuleEventNamespace($module, 'acpConfig');
     /**
      * @var \fpcm\model\abstracts\event
      */
     $module = new $className();
     if ($this->is_a($module)) {
         $module->run(null);
         return true;
     }
     return false;
 }
Пример #2
0
 /**
  * Fehlerseite ausgeben
  * @param string $text
  */
 private function errorPage($text)
 {
     $view = new \fpcm\model\view\error();
     $view->setMessage($text);
     $view->render();
     die;
 }
Пример #3
0
 /**
  * Controller-Processing
  * @return boolean
  */
 public function process()
 {
     $currentClass = get_class($this);
     if (strpos($currentClass, 'fpcm\\modules\\') !== false) {
         $modulename = explode('\\', $currentClass);
         $modulename = $modulename[2] . '/' . $modulename[3];
         if (!in_array($modulename, $this->enabledModules)) {
             trigger_error("Request for controller '{$currentClass}' of disabled module '{$modulename}'!");
             $view = new \fpcm\model\view\error();
             $view->setMessage("The controller '{$this->getRequestVar('module')}' is not enabled for execution!");
             $view->render();
             die;
         }
     }
     if (!$this->session->exists()) {
         $this->redirectNoSession();
         return false;
     }
     if ($this->permissions) {
         if (count($this->checkPermission) && !$this->permissions->check($this->checkPermission)) {
             $view = new \fpcm\model\view\error();
             $view->setMessage($this->lang->translate('PERMISSIONS_REQUIRED'));
             $view->render();
             die;
         }
         if ($this->session->getCurrentUser()->isAdmin() && $this->permissions->check(array('system' => 'update'))) {
             $this->checkUpdates();
         }
     }
     return true;
 }