Exemplo n.º 1
0
 public function login()
 {
     if (Session::get('loggin') == true) {
     }
     if (isset($_POST['submit'])) {
         $username = $_POST['username'];
         $password = $_POST['password'];
         $authmodel = new Auth_Model();
         $passwordhash = $authmodel->get_hash($username);
         if (password_verify($password, $passwordhash)) {
             Session::set('loggin', true);
             Session::set('username', $username);
         } else {
             include_once ROOT_PATH . "admin/views/admin/login.php";
             exit;
         }
     } else {
         include_once ROOT_PATH . "admin/views/admin/login.php";
         exit;
     }
 }
Exemplo n.º 2
0
<?php

Loader::loadModel('Auth_Model');
$oAuth = new Auth_Model();

echo 'From Bootstrap.php:<br/>';
if(!$oAuth->hasIdentity())
	echo 'you are not logged in.<br/>';

if(!$oAuth->isAdmin())
	echo 'you are not an admin.<br/>';