Example #1
0
 public function testLogOut()
 {
     $this->simulateLogin('*****@*****.**', true);
     $session = new Session();
     $this->assertTrue(Session::isLoggedIn());
     $this->assertTrue(Session::isAdmin());
     $this->assertEqual(Session::getLoggedInUser(), '*****@*****.**');
     $session->logOut();
     $this->assertFalse(Session::isLoggedIn());
     $this->assertFalse(Session::isAdmin());
     $this->assertNull(Session::getLoggedInUser());
 }
Example #2
0
<?php

require_once 'session/session.php';
require_once 'logIn/controller/logInController.php';
$session = new Session();
if ($session->isLoggedIn()) {
    $session->logOut();
}
$logInController = new LogInController();
echo $logInController->getHTML($session);
Example #3
0
    public function user() {

        Session::logOut();
    }
 public function logout($id = 0)
 {
     Session::logOut();
     return true;
 }
Example #5
0
 public function testLogOut()
 {
     $email = '*****@*****.**';
     $cookie_dao = DAOFactory::getDAO('CookieDAO');
     $cookie = $cookie_dao->generateForEmail($email);
     $_COOKIE[Session::COOKIE_NAME] = $cookie;
     $this->simulateLogin($email, true);
     $session = new Session();
     $this->assertTrue(Session::isLoggedIn());
     $this->assertTrue(Session::isAdmin());
     $this->assertEqual(Session::getLoggedInUser(), $email);
     $test_email = $cookie_dao->getEmailByCookie($cookie);
     $this->assertEqual($email, $test_email);
     $session->logOut();
     $this->assertFalse(Session::isLoggedIn());
     $this->assertFalse(Session::isAdmin());
     $this->assertNull(Session::getLoggedInUser());
     $test_email = $cookie_dao->getEmailByCookie($cookie);
     $this->assertNull($test_email);
 }
Example #6
0
<?php

include_once "classes/Session.php";
if (!empty($_POST['login']) && !empty($_POST['password'])) {
    Session::login($_POST['login'], $_POST['password']);
    if (empty($_SESSION['apiKey'])) {
        Session::getNetwork(Session::BITCOINTESTNET);
    }
}
if (Session::isLoggedIn() && isset($_GET['logout'])) {
    Session::logOut();
}
?>

<?php 
if (!Session::isLoggedIn()) {
    ?>
   <form class= "form-inline" method="POST" action="main.php">
<div align="center">
        <div class="form-group">
            <label>Email</label>
            <input type="email" class="form-control" id="email" placeholder="*****@*****.**" name="login">
        </div>
        <div class="form-group">
            <label>Password</label>
            <input type="password" class="form-control" id="password" placeholder="53543770Samsung" name="password">
        </div>
        <button type="submit" class="btn btn-default">Enter</button>
        </div>
    </form>