/** * @return boolean */ public function destruir() { if (isset($_SESSION)) { return session_destroy(); } return false; }
public function destroy() { foreach ($_SESSION as $var => $val) { $_SESSION[$var] = null; } session_destroy(); }
public function destroy_sess() { // Emtpy out the sessions array // then destroy the whole session $this->my_sess = array(); session_destroy(); }
public function tearDown() { $deleteuser = rex_sql::factory(); $deleteuser->setQuery('DELETE FROM ' . rex::getTablePrefix() . "user WHERE login = '******' LIMIT 1"); // make sure we don't mess up the global scope session_destroy(); }
/** * Handles user logout. */ public function logout() { $_SESSION = array(); session_destroy(); header('Location: ' . PHPCI_URL); die; }
public function logout() { if (isset($_SESSION['username'])) { session_destroy(); redirect(base_url()); } }
public static function stop() { foreach ($_SESSION as $k => $v) { unset($_SESSION[$k]); } session_destroy(); }
/** * Destroy sessions */ public static function reset() { if (!Session::checkStart()) { session_start(); } session_destroy(); }
function check_login($link, $user, $pass) { if (!ctype_alnum(str_replace(array('@', '.', '-'), '', $user))) { return false; } $pass = escapeshellcmd($pass); $result = mysqli_query($link, "SELECT password FROM admin WHERE superadmin='1' AND username='******'"); while ($row = mysqli_fetch_array($result, MYSQL_NUM)) { $row = "'" . $row[0] . "'"; if (strpos(shell_exec("echo {$pass} | doveadm pw -s SHA512-CRYPT -t {$row}"), "verified") !== false) { return "admin"; } } $result = mysqli_query($link, "SELECT password FROM admin WHERE superadmin='0' AND active='1' AND username='******'"); while ($row = mysqli_fetch_array($result, MYSQL_NUM)) { $row = "'" . $row[0] . "'"; if (strpos(shell_exec("echo {$pass} | doveadm pw -s SHA512-CRYPT -t {$row}"), "verified") !== false) { return "domainadmin"; } } $result = mysqli_query($link, "SELECT password FROM mailbox WHERE active='1' AND username='******'"); while ($row = mysqli_fetch_array($result, MYSQL_NUM)) { $row = "'" . $row[0] . "'"; if (strpos(shell_exec("echo {$pass} | doveadm pw -s SHA512-CRYPT -t {$row}"), "verified") !== false) { return "user"; } } session_unset(); session_destroy(); session_write_close(); setcookie(session_name(), '', 0, '/'); sleep(1); return false; }
function logof() { session_start(); $_SESSION['id'] = ''; session_destroy(); echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/index.php";</script>'; }
public function logout() { unset($_SESSION['FE']); $this->login = false; $this->level = 0; session_destroy(); }
public static function destroy() { if (self::$_sessionStarted == true) { session_unset(); session_destroy(); } }
function connexion() { try { //si le login et le mdp existent if (isset($_POST["login"]) && isset($_POST["mdp"])) { // récupération sécurisée du mdp et du login dans des variables $login = htmlspecialchars(addslashes(trim(strtoupper($_POST['login'])))); $password = htmlspecialchars(addslashes(trim(md5($_POST['mdp'])))); $_SESSION['login'] = $login; $query = "SELECT COL_NO, TAU_NO, COL_NOM, COL_PRENOM, COL_MNEMONIC FROM COLLABORATEUR WHERE COL_MNEMONIC='" . $login . "' AND (COL_PASSWORD='******' OR COL_PASS_ALL='" . $password . "')"; $result = $GLOBALS['connexion']->query($query); if (mysqli_num_rows($result) == 1) { $connection = true; $row = $result->fetch_assoc(); $_SESSION['col_id'] = $row['COL_NO']; $_SESSION['accreditation'] = $row['TAU_NO']; $_SESSION['nom'] = $row['COL_NOM']; $_SESSION['prenom'] = $row['COL_PRENOM']; $_SESSION['mnemonic'] = $row['COL_MNEMONIC']; header("Location: accueil.php"); //header ("Location: accueil_bloque.php"); } else { $_SESSION = array(); session_destroy(); return '<script>alert("Identifiant et/ou mot de passe incorrect");</script>'; } } else { $connection = false; } } catch (Exception $e) { // message en cas d'erreur die('Erreur : ' . $e->getMessage()); } return ''; }
public function process() { session_start(); $mysql = new pokeGOMySQL(); // check for name being passed in if (isset($this->inData['goBack'])) { header("location:LoginController.php"); } else { if (isset($this->inData['submitUser'])) { header("location:CreateNewUserController.php"); $this->myNEWUserName = $this->inData['myNEWUserName']; $this->myNEWPassword = $this->inData['myNEWPassword']; //$this->myNEWCONFIRMPassword = $this->inData['myNEWCONFIRMPassword']; //$_SESSION['myNEWCONFIRMPassword'] = $this->inData['myNEWCONFIRMPassword']; $_SESSION['myNEWPassword'] = $this->inData['myNEWPassword']; $_SESSION['myNEWUserName'] = $this->inData['myNEWUserName']; //$this->outData['myNEWCONFIRMPassword'] = $_SESSION['myNEWCONFIRMPassword']; $this->outData['myNEWPassword'] = $_SESSION['myNEWPassword']; $this->outData['myNEWUserName'] = $_SESSION['myNEWUserName']; $this->addUser($mysql); } else { // initialize a new session array, this is if the page is refreshed session_destroy(); //if the session_destroy does not destroy the session //this will force all $_SESSION into a new array $_SESSION = array(); } } }
function logOut() { session_destroy(); echo "<div class='alert alert-warning' role='alert'>Je bent nu uitgelogd.</div>"; $index = new Index(); $index->redirect('index.php'); }
function logout() { $objResponse = new xajaxResponse(); session_destroy(); $objResponse->script("location.reload();"); return $objResponse; }
public function disconnect() { if (!empty($_SESSION["AJXP_USER"])) { unset($_SESSION["AJXP_USER"]); session_destroy(); } }
function secretPage() { $guide = ""; $message = ""; $content = ""; $page = isset($_GET['page']) ? trim($_GET['page']) : 'default'; $logout = isset($_GET['logout']) ? trim($_GET['logout']) : false; if ($logout) { unset($_SESSION["logged"]); session_destroy(); header('Location: ./'); } if ($page == 1) { $content = "This is the very first hidden page.<br/>only logged in users can access this."; } else { if ($page == 2) { $content = "Only logged in users can access this one."; } else { if ($page == 3) { $content = "This one is almost empty.."; } else { if ($page == 'default') { $guide = "Correct! Welcome to the hidden pages"; $content = ""; } } } } showTitle($guide, $message); showHiddenPages($content); }
/** * Destroy session * * @access public * @return void */ public function destroy() { if (PHP_SESSION_ACTIVE === session_status()) { session_unset(); session_destroy(); } }
private static function generateId() { @session_start(); $id = session_id(); session_destroy(); return $id; }
public function logout() { unset($this->session->data['user_id']); $this->user_id = ''; $this->username = ''; session_destroy(); }
public static function logout() { if (isset($_SESSION["aid"])) { unset($_SESSION["aid"]); session_destroy(); } }
/** * @param bool|true $regenerate */ public function destroy($regenerate = true) { session_destroy(); if ($regenerate === true) { session_regenerate_id(true); } }
public function logout() { // remove and destroy session variables session_unset(); session_destroy(); header('Location: ' . $this->base_url()); }
public function disconnect() { //S'il n'est meme pas connecter et essaye d'ouvrir l'action disconnect //le redireger ver la page de connexion $this->backupDB(); if (!isset($this->session->user)) { header("Location:" . url("connexion")); } $id = $this->session->idconnexion; $connexion = "Connexion réussie"; /** il a deborder, sa session est expiree */ if ($this->session->timeout <= time()) { $datefin = date("Y-m-d H:i:s", $this->session->timeout); $deconnexion = "Session expriée"; } else { /** Il s'est deconnecter durant sa session normale */ $deconnexion = "Session fermée correctement"; $datefin = date("Y-m-d H:i:s", time()); } //updateConnexion($idconnexion, $connexion, $datefin, $deconnexion) $this->Connexion->updateConnexion($id, $connexion, $datefin, $deconnexion); unset($_SESSION['user']); unset($_SESSION['profile']); unset($_SESSION['droits']); unset($_SESSION['timeout']); unset($_SESSION['idconnexion']); unset($_SESSION['idprofile']); session_destroy(); header("Location:" . Router::url('connexion')); }
public function logoutAction() { session_unset(); session_destroy(); $ret["statusCode"] = CODE_SUCCESS; echo UtilsModel::getUrlJson($ret); }
public function loginoutOp() { session_unset(); session_destroy(); setNcCookie('goodsnum', '', -3600); showDialog(L('login_logout_success'), '', 'succ', '', 2); }
function run() { $consumer = getConsumer(); // Complete the authentication process using the server's // response. $return_to = getReturnTo(); $response = $consumer->complete($return_to); // Check the response status. if ($response->status == Auth_OpenID_CANCEL) { // This means the authentication was cancelled. $msg = 'Verification cancelled.'; if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time() - 42000, '/'); } session_destroy(); } else { if ($response->status == Auth_OpenID_FAILURE) { // Authentication failed; display the error message. $msg = "OpenID authentication failed: " . $response->message; if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time() - 42000, '/'); } session_destroy(); } else { if ($response->status == Auth_OpenID_SUCCESS) { // This means the authentication succeeded; extract the // identity URL and Simple Registration data (if it was // returned). $openid = $response->getDisplayIdentifier(); $esc_identity = escape($openid); $_SESSION = array(); $_SESSION['openid'] = $esc_identity; if ($response->endpoint->canonicalID) { $escaped_canonicalID = escape($response->endpoint->canonicalID); $success .= ' (XRI CanonicalID: ' . $escaped_canonicalID . ') '; $_SESSION['openid'] = $escaped_canonicalID; } // AX Process $ax_resp = Auth_OpenID_AX_FetchResponse::fromSuccessResponse($response); if ($ax_resp) { global $ax_data; foreach ($ax_data as $ax_key => $ax_data_ns) { if ($ax_resp->data[$ax_data_ns][0]) { $_SESSION['ax_' . $ax_key] = $ax_resp->data[$ax_data_ns][0]; } } } } } } if ($_GET["popup"] == "true") { include 'close.php'; } else { if ($_GET["callback"] == "ax") { header("Location: ./ax_example.php"); } else { header("Location: ./index.php"); } } }
public function logout() { session_unset(); session_destroy(); session_start(); $_SESSION['user_is_logged_in'] = false; }
/** Construction. This kills the current session if any started, and restart the given session */ public function __construct($name, $cleanPreviousSession = false) { if (session_id() == "") { // Start a default session and save on the handler session_start(); SessionSwitcher::$sessionArray[] = array('id' => session_id(), 'name' => session_name()); session_write_close(); } // Please note that there is no start here, session might be already started if (session_id() != "") { // There was a previous session if ($cleanPreviousSession) { if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time() - 42000, '/'); } session_destroy(); } // Close the session session_write_close(); session_regenerate_id(false); $_SESSION = array(); // Need to generate a new session id } session_id(md5(SessionSwitcher::$sessionArray[0]['id'] . $name)); session_name($name); session_start(); }