/** * Logout the user form the current symfony application and from the * CAS server * @param boolean $onlyLocal Set it to true, to logout from the application, but stay login in the CAS */ public function logout($url = null, $onlyLocal = false) { parent::signOut(); $this->username = null; if (!$onlyLocal) { sfCAS::initPhpCAS(); if (!empty($url)) { phpCAS::logoutWithUrl($url); } else { phpCas::logout(); } } }
*****************************************************************************/ /* Set error handler to own one, initialize time calculation and start session. */ session::start(); if (isset($_REQUEST['signout']) && $_REQUEST['signout']) { if (session::global_is_set('connected')) { $config = session::global_get('config'); if ($config->get_cfg_value('casActivated') == 'TRUE') { require_once 'CAS.php'; /* Move CAS autoload before FD autoload */ spl_autoload_unregister('CAS_autoload'); spl_autoload_register('CAS_autoload', TRUE, TRUE); phpCAS::client(CAS_VERSION_2_0, $config->get_cfg_value('casHost', 'localhost'), (int) $config->get_cfg_value('casPort', 443), $config->get_cfg_value('casContext', '')); // Set the CA certificate that is the issuer of the cert phpCAS::setCasServerCACert($config->get_cfg_value('casServerCaCertPath')); phpCas::logout(); } } session::destroy(); session::start(); } /* Reset errors */ session::set('errors', ''); session::set('errorsAlreadyPosted', ''); session::set('LastError', ''); /* Check if we need to run setup */ if (!file_exists(CONFIG_DIR . '/' . CONFIG_FILE)) { header('location:setup.php'); exit; } /* Check if fusiondirectory.conf (.CONFIG_FILE) is accessible */
$_SESSION['OCS']['SQL_BASE_VERS'] = $version_database; } else { msg_error($l->g(2114) . " " . $version_database); die; } } msg_success($l->g(1121)); echo "<br><br><br><b><a href='index.php'>" . $l->g(2051) . "</a></b>"; //Logout after update(s) //Contrib of FranciX (http://forums.ocsinventory-ng.org/viewtopic.php?pid=41923#p41923) if ($_SESSION['OCS']['cnx_origine'] == "CAS") { require_once PHPCAS; require_once BACKEND . 'require/cas.config.php'; $cas = new phpCas(); $cas->client(CAS_VERSION_2_0, $cas_host, $cas_port, $cas_uri); $cas->logout(); } //end contrib unset($_SESSION['OCS']); unset($_GET); } echo "</form>"; if (isset($_GET['debug'])) { unset($_SESSION['OCS']['DEBUG']); } require_once 'require/footer.php'; /* * function to execute sql file * */ function exec_fichier_sql($fichier)