public function logout()
 {
     session_start();
     $loginClass = new Login();
     $loginClass->logout();
     $this->redirect('');
 }
示例#2
0
文件: ajax.php 项目: Torredo/cms
 public function logout()
 {
     if ($_SERVER["REQUEST_METHOD"] !== "POST") {
         http_response_code(405);
         header("Allow: POST");
         $arr = array("error" => "Метод не POST");
         return $arr;
     }
     setcookie("sid", "");
     Login::logout();
     $arr = array("success" => "logout");
     return $arr;
 }
示例#3
0
 * received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, 
 * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
## Includes
$dirname = dirname(__FILE__);
require_once $dirname . DIRECTORY_SEPARATOR . 'include.php';
require_once CLASS_FILE_LOCATION . 'login.class.php';
## Instantiate login class
$login = new Login(USERDB_FILE_LOCATION, $config['use_domus_security']);
## Set template parameters
$tpl->set('title', $lang['login']);
$tpl->set('lang', $lang);
if (isset($_GET["action"])) {
    if ($_GET["action"] == "logout") {
        $login->logout();
        header("Location: login.php?from=index");
        exit;
    }
}
if (isset($_POST['password'])) {
    $remember = isset($_POST['remember']) ? true : false;
    if ($login->checkLoginByPin($_POST['password'], $remember)) {
        //			error_log("login.php successful for post from [". $_POST['from']."]");
        if (isset($_POST['from']) && $_POST['from'] != "") {
            header("Location: " . $_POST['from'] . ".php");
        } else {
            header("Location: index.php");
        }
    } else {
        //		error_log("login.php Unsuccessful");
示例#4
0
/**
 * Logout the current user for unauthorized access to the page
 */
function logoutUser()
{
    $login = new Login();
    $login->logout("Você deve ter permissão para acessar essa página.\n\t\t\t      Você foi deslogado por motivos de segurança.", "danger", '/');
}
示例#5
0
<?php

header('Content-Type: text/html; charset=utf-8');
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', dirname(__DIR__));
include ROOT . DS . 'config/Config.php';
include ROOT . DS . 'src/Login.php';
$log = new Login(new Config());
$log->logout();
示例#6
0
文件: index.php 项目: bas2/help
<?php

# Show login screen or display App screen if logged in.
//ini_set('display_errors', 1);
require_once '../../../includes/classes/Db.php';
#
require_once '../../../includes/classes/help.class.php';
$help = new Help();
require '../../../includes/classes/Login.php';
# Login class.
$login = new Login($help->sess_dir);
$login->startsession();
if (isset($_GET['act']) && $_GET['act'] == 'signout') {
    $login->login_page = '?act=l';
    # This script with (index.php?act=l). Redirect here after logging out.
    $login->logout($help->sessname);
    # Log the user out.
    $login->redirectIfNotLoggedIn($help->sessname, '?act=l');
    # Send to login page (/help/?act=l).
    exit;
}
// End if sign out code.
if (isset($_GET['act']) && $_GET['act'] == 'l') {
    // Send required fields so method can check whether they're not empty.
    $errrotext = $login->processLogin(array('txt_user' => 'Username', 'txt_pass' => 'Password'), $help);
}
// End if login attempted.
require '../../../includes/classes/Document.php';
if (isset($_GET['act']) && $_GET['act'] == 'l') {
    if ($login->isLoggedIn($help->sessname)) {
        exit;
示例#7
0
<?php

Login::logout(Login::$_login_front);
Login::restrictFront();
示例#8
0
        /*  manager Settings for blog */
    /*  manager Settings for blog */
    case 'themes':
        $admin->themes();
        break;
    case 'edit_theme':
        $admin->edit_theme(@$_REQUEST['theme_name']);
        break;
    case 'settings':
        $admin->settings();
        break;
    case 'updates':
        print $admin->updates(Core::VERSION);
        break;
    case 'clear_blog':
        $admin->clear_blog();
        break;
        //logout
    //logout
    case 'logout':
        $login->logout(@$_COOKIE['0xBlog_Username'], @$_COOKIE['0xBlog_Password'], @$_GET['security']);
        break;
        //print all articles for management
    //print all articles for management
    default:
        $admin->show_administration();
        break;
}
print "</div>\n";
$template->show_menu($class = 'admin');
$template->show_footer();
示例#9
0
文件: index.php 项目: juananpe/eebe
	public function prepare($uid){
			$obj = new stdClass;
			$obj->isAdmin = 1;
			$_SESSION['user-data'] = $obj;
			$_SESSION['uid'] = $uid;
	}

} // end Login class

$error="";

$page = new Login();

if (isset($_GET['action']) && $_GET['action']=='logout'){
	$page->logout();
}
if (isset($_SESSION['uid'])){
	$page->go("admin.php");
}else{
	if (isset($_POST['login']) && isset($_POST['password'])){
		if($uid = $page->check($_POST['login'], $_POST['password'])){
				$page->prepare($uid);
				$page->go("admin.php");
		}else{
			$error = "Incorrect login or password";
		}
	}
}
?>
<!DOCTYPE html>
示例#10
0
        }
    }
    function logout($target)
    {
        session_start();
        session_destroy();
        header(sprintf("location:%s", $target));
    }
    function forgot_password($email)
    {
    }
}
$action = $_GET["q"];
$login = new Login();
//$login->register("*****@*****.**","123456","user");
if ($action == 'login') {
    $login->logon($_POST['username'], $_POST['password']);
} else {
    if ($action == 'logout') {
        $login->logout('login/login.php');
    } else {
        if ($action == 'register') {
            $login->register($_POST['email'], $_POST['password'], $_POST['role']);
        }
    }
}
?>



示例#11
0
<?php

if (isset($_POST['ok'])) {
    $option = new Login();
    $option->logout();
    header('Location: ' . $_SERVER['PHP_SELF'] . '');
} elseif (isset($_POST['cancel'])) {
    header('Location: ' . $_SERVER['PHP_SELF'] . '');
} else {
    ?>
<div id="admin-login">
<h5><?php 
    echo _ADMIN_QUIZ_LOGOUT;
    ?>
</h5>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="50%" valign="top" align="center"><br>
    <div id="admin-icon" align="center"><img src="images/lock.jpg" hspace="5" vspace="5" ></div>
    </td>
    <td width="50%" align="center"><div id="admin-from">
    <form name="admin-login" method="post" action="<?php 
    $PHP_SELF;
    ?>
">
    <input name="ok" type="submit" id="submit" value="<?php 
    echo _ADMIN_OK;
    ?>
">
    <input name="cancel" type="submit" id="submit" value="<?php 
    echo _ADMIN_CANCEL;
示例#12
0
function logout()
{
    $app = Slim::getInstance();
    $l = new Login();
    $l->logout();
    $app->view()->setData('user', null);
    $app->redirect(URL_BASE . '/inicial');
}
示例#13
0
<?php

session_start();
$ip = $_SERVER['REMOTE_ADDR'];
include '../php/config.php';
require 'login.php';
require 'authorize.php';
$logout = new Login();
$logstatus = $logout->logout();
if ($logstatus) {
    echo "<center>";
    echo "<h1>SESSION SUCCESSFULLY CLEARED</h1>";
    echo "<a href='loginform.php'>LOGIN</a>";
    echo "</center>";
} else {
    echo "<center>";
    echo "<h1>SESSION FAILED TO DELETE FROM DATABASE</h1>";
    echo "<a href='logout.php'>RETRY</a>";
    echo "</center>";
}
示例#14
0
<?php

Login::logout(Login::$_login_page_admin);
Login::restrictAdmin();
 public function runAdmin()
 {
     $this->objAdmin = new Admin($this->objLanguage);
     if ($this->objUrl->main == 'logout') {
         Login::logout();
     } else {
         if ($this->objUrl->c == 'login' && Login::isLogged()) {
             Helper::redirect('/panel/content/c/pages/a/index');
         } else {
             if ($this->objUrl->c != 'login' && !Login::isLogged()) {
                 Helper::redirect('/panel');
             } else {
                 if (Login::isLogged()) {
                     $this->admin = $this->objAdmin->getOne($_SESSION[Login::$key_user_id]);
                 }
             }
         }
     }
     $file = ROOT_PATH . DS . 'admin' . DS . 'core' . DS . $this->objUrl->c . DS . $this->objUrl->a . '.php';
     if (!is_file($file)) {
         $file = ROOT_PATH . DS . 'admin' . DS . 'core' . DS . 'error' . DS . 'index.php';
     }
     ob_start();
     require_once $file;
     echo ob_get_clean();
 }
示例#16
0
 function password_submit()
 {
     $password = $this->_param("password");
     if (!empty($password)) {
         $password = D("Users")->genPassword($password);
         $user = D("Users")->getById($this->login_user['id']);
         if ($user) {
             // if($user['password_history']){
             //     $old_pass_array = unserialize($user['password_history']);
             //     foreach ($old_pass_array as $key => $old_pass) {
             //         if($password == $old_pass['password']){
             //             Session::Set("error", "新密码不能和最近三次密码相同");
             //             redirect("/setting");
             //         }
             //     }
             //     $old_pass_array[] = array("date" => date('Y-m-d H:i:s'), "password" => $password);
             //     if(count($old_pass_array) > 3){
             //         $old_pass_array = array_slice($old_pass_array, 1);
             //     }
             // }else{
             //     $old_pass_array[] = array("date" => date('Y-m-d H:i:s'), "password" => $password);
             // }
             // D("Users")->where("id=" . $this->login_user['id'])->setField("password",$password);
             // $user['password_history'] = serialize($old_pass_array);
             $user['password'] = $password;
             D("Users")->save($user);
             Login::logout();
         }
     }
     Session::set("success", L("update_success"));
     redirect("/setting");
 }
示例#17
0
$template = new Core();
$admin = new Admin();
$login = new Login();
@($action = $_GET['action']);
$template->PrintHeader();
$login->form_login(@$_COOKIE['password']);
$template->PrintAdminMenu();
switch ($action) {
    case 'del_sign':
        $admin->del_sign(@$_REQUEST['id']);
        break;
    case 'change_pass_admin':
        $admin->change_pass_admin();
        break;
    case 'themes':
        $admin->themes();
        break;
    case 'settings':
        $admin->settings();
        break;
    case 'updates':
        print $admin->updates(Core::VERSION);
        break;
    case 'logout':
        $login->logout(@$_COOKIE['password']);
        break;
    default:
        $admin->show_administration();
        break;
}
$template->PrintFooter();
 public function actionLogout()
 {
     Login::logout();
     $this->redirect('/site/index');
 }
示例#19
0
<?php

require_once 'includes/functions.php';
$login = new Login();
$template = new Template();
if (!$login->loggedIn()) {
    redirect("index", 3);
    $template->showMessage("you have to be logged in be here.", "Error");
}
if ($login->logout()) {
    redirect("index", 3);
    $template->showMessage("You have been logged out.", "info");
}
示例#20
0
<?php

/* 
 * Cierra la sesión como usuario validado
 */
include 'class.Login.php';
//incluimos las funciones
Login::logout();
//vacia la session del usuario actual
header('Location: ../index.php');
//saltamos a login.php
示例#21
0
 public function logout()
 {
     $result = Login::logout($this->_getInput());
     return Response::json($result);
 }
示例#22
0
    $upload_image = true;

}

// check if user is logged in
if ( Login::hasIdentity()) {
    $logoutLink = '<a href="' . $_SERVER['PHP_SELF'] . '?logout"> Logout </a>';

    // array of identity properties
    $identity = Login::getIdentity();
    $upload_image = true;
}

// logout user
if( isset( $_GET['logout'] ) ) {
    $success = Login::logout();
    $logoutLink = '';
    $message = Login::getMessenger();
    $upload_image = false;
}

echo '<script>';
echo 'window.opener.document.getElementById("TGP_submit_button").style.display = "block";';
echo 'window.opener.document.getElementById("signin_type").value = "email";';
echo 'window.opener.tgp_emailsignform();';
echo 'window.opener.tgp_showautopost(\'email\');';
echo 'window.opener.tgp_closeemail();';
echo 'window.close();';
echo '</script>';

?>
示例#23
0
<?php

Login::logout(Login::$_login_admin);
Login::restrictAdmin();
示例#24
0
 function logout()
 {
     Login::logout();
 }
示例#25
0
文件: index.php 项目: bas2/diary
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
//ini_set('display_errors', 1);
require_once '../../../includes/classes/Db.php';
# Database class.
require_once 'inc/Diary.php';
$diary = new Diary();
$diary->dbConn('../../../_db/diary.php');
require 'inc/func.php';
require '../../../includes/classes/Login.php';
# Login class.
$login = new Login($diary->sess_dir);
$login->startsession();
if (isset($_GET['act']) && $_GET['act'] == 'signout') {
    $login->login_page = '?act=l';
    $login->logout($diary->sessname);
    $login->redirectIfNotLoggedIn($diary->sessname, '?act=l');
    exit;
}
// End if.
if (isset($_GET['act']) && $_GET['act'] == 'l') {
    $errrotext = $login->processLogin(array('txt_user' => 'Username', 'txt_pass' => 'Password'), $diary);
}
// End if.
require '../../../includes/classes/Document.php';
# Document class.
if (isset($_GET['act']) && $_GET['act'] == 'l') {
    if ($login->isLoggedIn($diary->sessname)) {
        exit;
    }
    $document = new Document('Diary::Login to view this page!');