protected function displayContent() { if ($this->app->session->isLoggedIn() || $this->app->config->pinhole->passphrase == '') { return; } $login_button = new SwatButton(); $login_button->title = Pinhole::_('Login'); $login_button->classes[] = 'compact-button'; $passphrase = new SwatPasswordEntry('passphrase'); $login_form_field = new SwatFormField(); $login_form_field->addChild($passphrase); $login_form_field->addChild($login_button); $login_form = new SwatForm('login_form'); $login_form->addChild($login_form_field); $login_form->action = $this->app->getBaseHref(true) . $this->app->config->pinhole->path . 'login'; $login_form->display(); $this->html_head_entry_set->addEntrySet($login_form->getHtmlHeadEntrySet()); }
/** * Configures modules of this application before they are initialized * * @param SiteConfigModule $config the config module of this application to * use for configuration other modules. */ protected function configure(SiteConfigModule $config) { parent::configure($config); $this->addComponentIncludePath('Blorg/admin/components', 'Blorg'); $this->addComponentIncludePath('Site/admin/components', 'Site'); if (isset($config->exceptions->log_location)) { SwatException::setLogger(new SiteExceptionLogger($config->exceptions->log_location, $config->exceptions->base_uri)); } if (isset($config->errors->log_location)) { SwatError::setLogger(new SiteErrorLogger($config->errors->log_location, $config->errors->base_uri)); } SwatForm::$default_salt = $config->swat->form_salt; $this->database->dsn = $config->database->dsn; $this->setBaseUri($config->uri->base . 'admin/'); $this->setSecureBaseUri($config->uri->secure_base . 'admin/'); $this->cookie->setSalt($config->cookies->salt); $this->default_time_zone = new HotDateTimeZone($config->date->time_zone); $this->default_locale = $config->i18n->locale; $config->session->name .= '-' . $_GET['instance']; if (isset($this->memcache)) { $this->memcache->server = $config->memcache->server; $this->memcache->app_ns = $config->memcache->app_ns; } }
/** * Configures modules of this application before they are initialized * * @param SiteConfigModule $config the config module of this application to * use for configuration other modules. */ protected function configure(SiteConfigModule $config) { parent::configure($config); if (isset($config->exceptions->log_location)) { SwatException::setLogger(new SiteExceptionLogger($config->exceptions->log_location, $config->exceptions->base_uri, $config->email->logging_address)); } if (isset($config->errors->log_location)) { SwatError::setLogger(new SiteErrorLogger($config->errors->log_location, $config->errors->base_uri, $config->email->logging_address)); } SwatForm::$default_salt = $config->swat->form_salt; $this->database->dsn = $config->database->dsn; $this->setBaseUri($config->uri->base); $this->setSecureBaseUri($config->uri->secure_base); $this->default_time_zone = new Date_TimeZone($config->date->time_zone); $this->analytics->setGoogleAccount($config->analytics->google_account); }
/** * Configures modules of this application before they are initialized * * @param SiteConfigModule $config the config module of this application to * use for configuration other modules. */ protected function configure(SiteConfigModule $config) { parent::configure($config); SwatForm::$default_salt = $config->swat->form_salt; $this->database->dsn = $config->database->dsn; $this->setBaseUri($config->uri->base); $this->setSecureBaseUri($config->uri->secure_base); $this->default_time_zone = new HotDateTimeZone($config->date->time_zone); setlocale(LC_ALL, $config->i18n->locale); if (isset($this->memcache)) { $this->memcache->server = $config->memcache->server; $this->memcache->app_ns = $config->memcache->app_ns; } }