/** * Executes index action * * @param sfRequest $request A request object */ public function executeInit(sfWebRequest $request) { //Check if kernel init went fine: $this->status = $this->getContext()->get('KernelStatus'); $this->getContext()->getUser()->setAttribute('relativeUrlRoot', $request->getRelativeUrlRoot()); //Add the log entry corresponding to the Kernel status: $log_ok = $this->getContext()->get('Kernel')->addLogIf(empty($this->status), array('info' => 'Application startup successful', 'error' => 'Application startup failed.')); //Check if error occured while logging: if (!$log_ok) { $this->status['log'] = 'Log files are unreachable, please check permissions on the log directory.'; } //Edit the databases.yml file: ParametersConfiguration::editYaml(); //Redirect to the localized homepage if everything went fine: $usersAuth = new usersAuth(); /*Depending on the user Type (disconnected, admin, viewer), a redirection is done*/ if ($usersAuth->isAdmin()) { $this->redirectIf(empty($this->status), '@localized_homepage'); } else { if ($usersAuth->isViewer()) { $this->redirectIf(empty($this->status), '@localized_homepage'); } else { $this->redirectIf(empty($this->status), '@authentification'); } } }
</li> </ul> <p> <?php echo __('For further information') . __(': ') . '<a href="http://www.opengenepi.org"><b>' . 'http://www.opengenepi.org' . '</b></a>' . '.'; ?> </p> </div> <div id="ban"></div> <div id="menus"> <div id="configurationAndUserName"> <?php $usersAuth = new usersAuth(); if ($usersAuth->isAdmin()) { //if the user is an admin, the whole configuration menu ?> <div id="configurationMenu"> <span> <a href="<?php echo url_for('auth/disconnect'); ?> "> <?php echo image_tag('exit.png', array('class' => 'config_picture', 'title' => __('Disconnect'))); ?> </a> </span> <span> <?php