function run() { $sth = $this->db->prepare("SELECT userid, role FROM user WHERE \n\t\t\tusername = :username AND password = :password"); $sth->execute(array(':username' => $_POST['username'], ':password' => \Libs\Hash::create('sha256', $_POST['password'], HASH_PASSWORD_KEY))); $data = $sth->fetch(); $count = $sth->rowCount(); if ($count > 0) { // login \Libs\Session::init(); \Libs\Session::set('role', $data['role']); \Libs\Session::set('loggedIn', true); \Libs\Session::set('userid', $data['userid']); header('location: ../dashboard'); } else { header('location: ../login'); } }
public function run() { $pet = DAO::on('Pet')->findById(1); Session::set('pet', $pet); header('Location: ' . URL . 'pet/index'); }
public function stepThree() { Session::set('planet', $_POST['planet']); $this->view->render('register/step_three'); }
public function play(\Libs\Toy $toy) { // Test echo 'Playing with... ' . get_class($toy); $this->stress -= 5; Session::set('pet', $this); header('Location: ' . URL . 'pet/index'); exit; $placid = $kind->playWithToy($toy); // new Ball $this->setStress($placid); }