SHARE
TWEET

Untitled

a guest Jun 15th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function start($user, $password) {
  2.         $conn = MySQL::getInstance()->getConnector();
  3.         $DAO = new DAO();
  4.         $user = new StringExpression($user);
  5.         $password = new StringExpression($password);
  6.        
  7.         if($flood = Cookie::getInstance()->get('flooding')){
  8.             $this->last_message = 'Acesso bloqueado por 5 minutos!';
  9.             $this->notify();
  10.             header('Location: '.URL_ROOT.'login.php');
  11.             return  false;
  12.         }
  13.        
  14.         $DAO->select()->table('users')->where("user_name = {$user->interpret($conn)} AND user_pswd = MD5({$password->interpret($conn)})");
  15.         if($result = $DAO->fetchOne()){
  16.             Session::getInstance()->set('uid', $result['uid']);
  17.             $this->last_message = null;
  18.             $this->notify();
  19.             header('Location: '.URL_ROOT);
  20.         } else {
  21.             $this->last_message = 'Usu├írio e/ou senha incorretos!';
  22.             $this->notify();
  23.             header('Location: '.URL_ROOT.'login.php');
  24.         }
  25.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top