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; } }
<?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/>';