Exemplo n.º 1
0
 /**
  * Instantiate front controller
  *
  * @return $this
  */
 private function setupFrontController()
 {
     $this->frontController = Zend_Controller_Front::getInstance();
     $this->frontController->setRequest($this->getRequest());
     $this->frontController->setControllerDirectory($this->getApplicationDir('/controllers'));
     $displayExceptions = $this->config->get('global', 'show_stacktraces', true);
     if ($this->user !== null && $this->user->can('application/stacktraces')) {
         $displayExceptions = $this->user->getPreferences()->getValue('icingaweb', 'show_stacktraces', $displayExceptions);
     }
     $this->frontController->setParams(array('displayExceptions' => $displayExceptions));
     return $this;
 }
Exemplo n.º 2
0
 /**
  * Setup internationalization using gettext
  *
  * Uses the preferred user language or the configured default and system default, respectively.
  *
  * @return  self
  */
 protected function setupInternationalization()
 {
     parent::setupInternationalization();
     if ($this->user !== null && $this->user->getPreferences() !== null && ($locale = $this->user->getPreferences()->get('app.language') !== null)) {
         try {
             Translator::setupLocale($locale);
         } catch (Exception $error) {
             Logger::warning('Cannot set locale "' . $locale . '" configured in ' . 'preferences of user "' . $this->user->getUsername() . '"');
         }
     }
     return $this;
 }