コード例 #1
0
ファイル: globals.php プロジェクト: IASA-GR/appdb-core
 public static function logout($session = null)
 {
     self::clearUserCredentails($session);
     Zend_Session::destroy(true);
     clearAuthCookies();
     @session_regenerate_id(FALSE);
     session_unset();
 }
コード例 #2
0
 public function logoutAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     Zend_Session::destroy(true);
     clearAuthCookies();
     header('Location: http://' . $_SERVER['HTTP_HOST']);
 }
コード例 #3
0
ファイル: login.php プロジェクト: sabirvirtuoso/AID
 try {
     $sqllastlogin = '******';
     $sthlastlogin = $dbconn->prepare($sqllastlogin);
     $sthlastlogin->execute(array(':user_id' => $_SESSION['user_id'], ':last_login' => date('m-d-Y')));
 } catch (PDOException $e) {
     echo $e->getMessage();
 }
 //Cookie
 if ($_POST['remember'] == 'true') {
     $ipMd5 = md5($_SERVER['REMOTE_ADDR']);
     $token = setLoginToken('NEW');
     setcookie('AID_USER', $result['user_id'], time() + 2592000);
     setcookie('AID_TOKEN', $token, time() + 2592000);
     setcookie('AID_AUTH', $ipMd5, time() + 2592000);
 } else {
     clearAuthCookies();
 }
 //to check the meta values in user_meta
 $sqlmeta = "SELECT * FROM user_meta WHERE user_id = :user_id";
 $sthmeta = $dbconn->prepare($sqlmeta);
 $sthmeta->execute(array(':user_id' => $_SESSION['user_id']));
 $usermeta = $sthmeta->fetch(PDO::FETCH_ASSOC);
 $sqlmeta2 = "UPDATE user_meta SET force_welcome=false,force_flash=null,force_pro_update=false,force_tour=false WHERE user_id = :user_id";
 $sthmeta2 = $dbconn->prepare($sqlmeta2);
 $sthmeta2->execute(array(':user_id' => $_SESSION['user_id']));
 /*Meta actions*/
 $_SESSION['info'] = array();
 if ($usermeta['force_welcome'] == 1) {
     array_push($_SESSION['info'], 'Welcome to AID, Please go through the <a href="index.php?page=help">Help section</a>.');
 }
 if (strlen($usermeta['force_flash']) > 0) {