コード例 #1
0
 public function testLogoutLogout()
 {
     $response = $this->auth->logOut();
     $this->assertTrue($response);
     $response = $this->auth - logOut();
     $this->assertTrue($response);
     $this->assertFalse($this->auth->isAuthenticated());
     $this->assertEqual($auth->getNaam(), null);
 }
コード例 #2
0
ファイル: pSeguranca.php プロジェクト: juniormelo/eimoveis
function protegePagina()
{
    global $_SG;
    if (!isset($_SESSION['idUsuario']) or !isset($_SESSION['login'])) {
        logOut();
    } else {
        if (empty($_SESSION['idUsuario']) || empty($_SESSION['login'])) {
            logOut();
        }
    }
}
コード例 #3
0
function manageUsers()
{
    global $wpdb;
    global $url, $queryStrStart;
    ?>
	<script type="text/javascript">
		function manageForm(e){
			var formName = jQuery(e).attr('for');
			jQuery('#signup').addClass('display-none');
			jQuery('#login').addClass('display-none');
			jQuery('#'+formName).removeClass('display-none');
		}
	</script>
	<?php 
    createUserTable();
    // if User SESSION is not set than show LOGIN, and Sign Up Form
    if (!isset($_SESSION['UserId'])) {
        createSignUpForm();
        createLoginForm();
    } else {
        logOut();
        $userId = $_SESSION['UserId'];
        echo '<div class="row-1" style="text-align:right">
				<a href="' . $url . '">Profile</a> | 
				<a href="' . $url . $queryStrStart . 'action=manage">Manage Property</a> | 
				<a href="' . $url . $queryStrStart . 'action=add">Add Property</a> | 
				<a href="' . $url . $queryStrStart . 'action=logout">Log Out</a>
			</div>';
        if (isset($_REQUEST['action']) && $_REQUEST['action'] == "add") {
            proprty_manage_form();
        } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == "manage") {
            user_property_display($_SESSION['UserId']);
        } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == "update" && isset($_REQUEST['pid'])) {
            proprty_manage_form($_REQUEST['pid']);
        } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == "delete" && isset($_REQUEST['pid'])) {
            user_property_delete($_REQUEST['pid']);
        } else {
            createSignUpForm($userId);
        }
    }
}
コード例 #4
0
<?php

session_start();
include_once 'functions.php';
$command = $_POST['command'];
$params = buildParams();
//set up testing output file
switch ($command) {
    case -1:
        logOut();
        break;
    case 0:
        loggedInCheck();
        break;
    case 0.1:
        // create user
        $_SESSION['new_user'] = true;
        $_SESSION['firstname'] = $_POST['firstname'];
        $_SESSION['lastname'] = $_POST['lastname'];
        $_SESSION['organization'] = $_POST['organization'];
        $_SESSION['username'] = $_POST['username'];
        $_SESSION['email'] = $_POST['email'];
        $_SESSION['password'] = $_POST['password'];
        echo 200;
        break;
    case 1:
        if (isset($_SESSION['organization'])) {
            $params = $params . '&username='******'organization'] . '&email=' . $_SESSION['email'] . '&password='******'password'];
            write("case 1-creating organization:\n" . $params);
            //TODO remove test case
            echo 200;
コード例 #5
0
include_once '../functions/utils-function.php';
$logout = false;
if (isPostRequest()) {
    $email = filter_input(INPUT_POST, 'email');
    $password = filter_input(INPUT_POST, 'pass');
    $logout = filter_input(INPUT_POST, 'logout');
    if (isValidUser($email, $password)) {
        $_SESSION['isValidUser'] = true;
    } else {
        $results = 'Sorry please try again';
    }
}
if (isset($_SESSION['isValidUser']) && $_SESSION['isValidUser'] === true) {
    include '../includes/admin-links.html.php';
}
?>
        
        <?php 
include '../includes/results.html.php';
?>
       <?php 
if (!isset($_SESSION['isValidUser'])) {
    include '../includes/loginform.html.php';
} else {
    include '../includes/logoutform.html.php';
    logOut($logout);
}
?>
    </body>
</html>
コード例 #6
0
ファイル: index.php プロジェクト: qlsove/old.faq
                                      <!--початок хедера -->

 
<?php 
error_reporting(0);
require_once "app/model/configs/init.php";
$titles = $header->find()->sort(array("index" => 1));
if (!empty($_COOKIE['site'])) {
    $cat = $_COOKIE['site'];
}
switch (true) {
    case isset($_POST['in']):
        logIn($_POST);
        break;
    case isset($_GET['out']):
        logOut($_GET, $_POST);
        break;
}
if (empty($_COOKIE['LoginOK'])) {
    ?>
 <div class="in">

<div class="mypage">     
<div class="login">
	<form class="foform" action="index.php" method = "POST" >
  <div>
    <label for="inputLogin">Логін</label>
    <div>
      <input type="text" name="login" id="inputLogin" placeholder="Email">
    </div>
  </div>
コード例 #7
0
ファイル: index.php プロジェクト: joyeop/Monsta-FTP
function checkReferer()
{
    global $lang_session_expired;
    if (empty($_SERVER["HTTP_REFERER"])) {
        return 0;
    }
    $domain = $_SESSION["domain"];
    $domain = str_replace(".", "\\.", $domain);
    if (preg_match("/" . $domain . "/", $_SERVER["HTTP_REFERER"])) {
        return 1;
    } else {
        sessionExpired($lang_session_expired);
        logOut();
        return 0;
    }
}
コード例 #8
0
ファイル: logout.php プロジェクト: vladvoth/adviceList
<?php

include '../../settings.php';
include '../../inc/login_functions.php';
logOut($mysqli);
header("Location: ../Login/login.php");
exit;
コード例 #9
0
function sessionX()
{
    $logLength = 1800;
    # time in seconds :: 1800 = 30 minutes
    $ctime = strtotime("now");
    if (!isset($_SESSION['sessionX'])) {
        $_SESSION['sessionX'] = $ctime;
    } else {
        if (strtotime("now") - $_SESSION['sessionX'] > $logLength && isLogged()) {
            logOut();
            header("Location: /login.php");
            exit;
        } else {
            $_SESSION['sessionX'] = $ctime;
        }
    }
}
コード例 #10
0
ファイル: index.php プロジェクト: stamlercas/csa
function ProcessLogOut()
{
    logOut();
    if (isset($_REQUEST["RequestedPage"])) {
        header("Location:" . $_REQUEST["RequestedPage"]);
    } else {
        header("Location:../security/index.php");
    }
}
コード例 #11
0
ファイル: login.php プロジェクト: patelas7/mi349fall2015
header('Access-Control-Allow-Headers: Content-Type, Content-Range, Content-Disposition, Content-Description');
require_once "db.inc.php";
$postData = file_get_contents("php://input");
$request = json_decode($postData);
$method = $request->method;
$username = $request->username;
if ($method == "login") {
    $password = $request->password;
    login($username, $password);
} else {
    if ($method == "create") {
        $password = $request->password;
        create($username, $password);
    } else {
        if ($method == "logout") {
            logOut($username);
        }
    }
}
function login($username, $password)
{
    $data = array();
    $connection = pdo_connect();
    $query = <<<SQL
SELECT Password, ID
FROM USERS
WHERE Username = ?
SQL;
    $statement = $connection->prepare($query);
    $statement->execute(array($username));
    if ($row = $statement->fetch()) {
コード例 #12
0
ファイル: index.php プロジェクト: inscriptionweb/MonstaFTP
function checkLogOut()
{
    if (isset($_GET["logout"]) && $_GET["logout"] == 1) {
        logOut();
    }
}
コード例 #13
0
ファイル: logout.php プロジェクト: ishvaram/simple-inventory
<?php

include 'header.php';
if (logOut() == 4) {
    redirectTo('../index.php', 3);
    echo '<div class="alert alert-success">Logout Successfully</a>.
                            </div>';
}