logout() public static method

public static logout ( )
Exemplo n.º 1
0
 /**
  */
 public function logout()
 {
     if ($access_token = $this->input['access_token']) {
         $data['access_token'] = $access_token;
     } else {
         $this->errorOutput(NO_ACCESS_TOKEN);
     }
     $Members = new members();
     $device_token = $Members->check_device_token(trim($this->input['device_token']));
     $udid = $Members->check_udid(trim($this->input['uuid']));
     if ($device_token === 0) {
         $this->errorOutput(ERROR_DEVICE_TOKEN);
     }
     if ($udid === 0) {
         $this->errorOutput(ERROR_UDID);
     }
     $auth = new auth();
     $logoutInfo = $auth->logout($data);
     //会员痕迹
     $member_trace_data = array('member_id' => $logoutInfo['user_id'], 'member_name' => $logoutInfo['user_name'], 'content_id' => $logoutInfo['user_id'], 'title' => $logoutInfo['user_name'], 'type' => 'logout', 'op_type' => '退出', 'appid' => $logoutInfo['appid'], 'appname' => $logoutInfo['display_name'], 'create_time' => TIMENOW, 'ip' => hg_getip(), 'device_token' => $device_token, 'udid' => $udid);
     $mMember = new member();
     $mMember->member_trace_create($member_trace_data);
     $_logoutInfo = array('member_id' => $logoutInfo['user_id'], 'member_name' => $logoutInfo['user_name'], 'is_member' => $logoutInfo['is_member'], 'logout' => $logoutInfo['logout']);
     $this->addItem($_logoutInfo);
     $this->output();
 }
Exemplo n.º 2
0
 public function index()
 {
     access::verify_csrf();
     auth::logout();
     if ($continue_url = Input::instance()->get("continue_url")) {
         url::redirect($continue_url);
     }
     url::redirect(item::root()->abs_url());
 }
Exemplo n.º 3
0
 public function index()
 {
     auth::logout();
     if ($continue_url = Input::instance()->get("continue")) {
         $item = url::get_item_from_uri($continue_url);
         if (access::can("view", $item)) {
             // Don't use url::redirect() because it'll call url::site() and munge the continue url.
             header("Location: {$continue_url}");
         } else {
             url::redirect(item::root()->abs_url());
         }
     }
 }
Exemplo n.º 4
0
    // If without party-module: just give a fake ID, for many modules need it
    class party
    {
        var $party_id;
    }
    $party = new party();
    $party->party_id = (int) $cfg['signon_partyid'];
}
if ($config['environment']['configured'] != 0) {
    if ($_GET['mod'] == 'auth') {
        switch ($_GET['action']) {
            case 'login':
                $auth = $authentication->login($_POST['email'], $_POST['password']);
                break;
            case 'logout':
                $auth = $authentication->logout();
                $_GET['mod'] = 'home';
                break;
            case 'switch_to':
                // Switch to user
                $authentication->switchto($_GET["userid"]);
                break;
            case 'switch_back':
                // Switch back to Adminuser
                $authentication->switchback();
                break;
        }
    }
}
### Set Default-Design, if non is set
/*
Exemplo n.º 5
0
/**********************************************************************
 *	N/X - Web Content Management System
 *	Copyright 2002 Sven Weih, FZI Research Center for Information Technologies
 *	www.fzi.de
 *
 *	This file is part of N/X.
 *	The initial has been setup as a small diploma thesis (Studienarbeit) at the FZI.
 *	It was be coached by Prof. Werner Zorn and Dipl.-Inform Thomas Gauweiler.
 *
 *	N/X is free software; you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation; either version 2 of the License, or
 *	(at your option) any later version.
 *
 *	N/X is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with N/X; if not, write to the Free Software
 *	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 **********************************************************************/
require_once "../../config.inc.php";
$auth = new auth("ANY");
$auth->logout();
session_destroy();
$db->close();
// forward to login page
header("Location: " . $c["docroot"] . "api/auth/loginform.php");
exit;
Exemplo n.º 6
0
<?php

// Initialize
global $template, $auth;
// Logout
$client = new auth();
$client->logout();
$GLOBALS['userid'] = 0;
// User message
$template->add_message("You have been succesfully logged out.");
Exemplo n.º 7
0
                  </form>';
    }
} else {
    //login form if we don't have action
    echo '
                  <form action="" method="post">
                  <input type="text" name="nick" placeholder="Логин" required>
                  <input type="password" name="pass" placeholder="Пароль" required>
                  <input type="submit" name="login" value="Авторизироваться!">
                  </form>
                  <a href="?action=register">Register</a>
                  ';
}
if (isset($_GET['action']) and $_GET['action'] == 'logout') {
    //logouting
    $user->logout();
}
if (isset($_POST['login'])) {
    //logging
    if ($user->login($_POST['nick'], $_POST['pass'])) {
    } else {
        echo $user->error_msg;
    }
}
if (isset($_POST['register'])) {
    //registering
    if ($user->register($_POST['nick'], $_POST['email'], $_POST['pass'], $_POST['r_pass'], $_POST['name'])) {
    } else {
        echo $user->error_msg;
    }
}
Exemplo n.º 8
0
 /**
  *
  */
 public function logout()
 {
     auth::logout();
     return Redirect()->intended('login');
 }