コード例 #1
0
 /**
  * @return boolean
  */
 public function destruir()
 {
     if (isset($_SESSION)) {
         return session_destroy();
     }
     return false;
 }
コード例 #2
0
 public function destroy()
 {
     foreach ($_SESSION as $var => $val) {
         $_SESSION[$var] = null;
     }
     session_destroy();
 }
コード例 #3
0
 public function destroy_sess()
 {
     // Emtpy out the sessions array
     // then destroy the whole session
     $this->my_sess = array();
     session_destroy();
 }
コード例 #4
0
ファイル: backend_login_test.php プロジェクト: staabm/redaxo
 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();
 }
コード例 #5
0
ファイル: SessionController.php プロジェクト: kukupigs/PHPCI
 /**
  * Handles user logout.
  */
 public function logout()
 {
     $_SESSION = array();
     session_destroy();
     header('Location: ' . PHPCI_URL);
     die;
 }
コード例 #6
0
ファイル: Pinasikat.php プロジェクト: TUPM-BSCS/pinasikat
 public function logout()
 {
     if (isset($_SESSION['username'])) {
         session_destroy();
         redirect(base_url());
     }
 }
コード例 #7
0
 public static function stop()
 {
     foreach ($_SESSION as $k => $v) {
         unset($_SESSION[$k]);
     }
     session_destroy();
 }
コード例 #8
0
ファイル: Session.php プロジェクト: quenti77/easyhq
 /**
  * Destroy sessions
  */
 public static function reset()
 {
     if (!Session::checkStart()) {
         session_start();
     }
     session_destroy();
 }
コード例 #9
0
ファイル: functions.inc.php プロジェクト: efux/mailcow
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;
}
コード例 #10
0
ファイル: metodos.php プロジェクト: hexti/casamento
function logof()
{
    session_start();
    $_SESSION['id'] = '';
    session_destroy();
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/index.php";</script>';
}
コード例 #11
0
 public function logout()
 {
     unset($_SESSION['FE']);
     $this->login = false;
     $this->level = 0;
     session_destroy();
 }
コード例 #12
0
ファイル: session.php プロジェクト: viralsolani/yapf
 public static function destroy()
 {
     if (self::$_sessionStarted == true) {
         session_unset();
         session_destroy();
     }
 }
コード例 #13
0
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 '';
}
コード例 #14
0
 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();
         }
     }
 }
コード例 #15
0
ファイル: login.class.php プロジェクト: emilev90/intekenbord
 function logOut()
 {
     session_destroy();
     echo "<div class='alert alert-warning' role='alert'>Je bent nu uitgelogd.</div>";
     $index = new Index();
     $index->redirect('index.php');
 }
コード例 #16
0
ファイル: logout.php プロジェクト: MaliahRajan/online_exam
 function logout()
 {
     $objResponse = new xajaxResponse();
     session_destroy();
     $objResponse->script("location.reload();");
     return $objResponse;
 }
コード例 #17
0
 public function disconnect()
 {
     if (!empty($_SESSION["AJXP_USER"])) {
         unset($_SESSION["AJXP_USER"]);
         session_destroy();
     }
 }
コード例 #18
0
ファイル: index.php プロジェクト: anhpham1509/WebProgramming
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);
}
コード例 #19
0
ファイル: Session.php プロジェクト: dp-ifacesoft/micro
 /**
  * Destroy session
  *
  * @access public
  * @return void
  */
 public function destroy()
 {
     if (PHP_SESSION_ACTIVE === session_status()) {
         session_unset();
         session_destroy();
     }
 }
コード例 #20
0
ファイル: SessionStorage.php プロジェクト: unkerror/Budabot
 private static function generateId()
 {
     @session_start();
     $id = session_id();
     session_destroy();
     return $id;
 }
コード例 #21
0
ファイル: user.php プロジェクト: myjavawork/shcoyee
 public function logout()
 {
     unset($this->session->data['user_id']);
     $this->user_id = '';
     $this->username = '';
     session_destroy();
 }
コード例 #22
0
 public static function logout()
 {
     if (isset($_SESSION["aid"])) {
         unset($_SESSION["aid"]);
         session_destroy();
     }
 }
コード例 #23
0
 /**
  * @param bool|true $regenerate
  */
 public function destroy($regenerate = true)
 {
     session_destroy();
     if ($regenerate === true) {
         session_regenerate_id(true);
     }
 }
コード例 #24
0
ファイル: student.php プロジェクト: ahmedBassell/dbproject
 public function logout()
 {
     // remove and destroy session variables
     session_unset();
     session_destroy();
     header('Location: ' . $this->base_url());
 }
コード例 #25
0
ファイル: connexionController.php プロジェクト: jpainam/cosba
 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'));
 }
コード例 #26
0
ファイル: User.php プロジェクト: sunniecc/web_pakpobox
 public function logoutAction()
 {
     session_unset();
     session_destroy();
     $ret["statusCode"] = CODE_SUCCESS;
     echo UtilsModel::getUrlJson($ret);
 }
コード例 #27
0
ファイル: login.php プロジェクト: Maplecms/shopnc-api
 public function loginoutOp()
 {
     session_unset();
     session_destroy();
     setNcCookie('goodsnum', '', -3600);
     showDialog(L('login_logout_success'), '', 'succ', '', 2);
 }
コード例 #28
0
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");
        }
    }
}
コード例 #29
0
ファイル: LoginHandler.php プロジェクト: rmatil/angular-cms
 public function logout()
 {
     session_unset();
     session_destroy();
     session_start();
     $_SESSION['user_is_logged_in'] = false;
 }
コード例 #30
-1
ファイル: sessionSwitcher.php プロジェクト: skdong/nfs-ovd
 /** 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();
 }