Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function start($user, $password) {
- $conn = MySQL::getInstance()->getConnector();
- $DAO = new DAO();
- $user = new StringExpression($user);
- $password = new StringExpression($password);
- if($flood = Cookie::getInstance()->get('flooding')){
- $this->last_message = 'Acesso bloqueado por 5 minutos!';
- $this->notify();
- header('Location: '.URL_ROOT.'login.php');
- return false;
- }
- $DAO->select()->table('users')->where("user_name = {$user->interpret($conn)} AND user_pswd = MD5({$password->interpret($conn)})");
- if($result = $DAO->fetchOne()){
- Session::getInstance()->set('uid', $result['uid']);
- $this->last_message = null;
- $this->notify();
- header('Location: '.URL_ROOT);
- } else {
- $this->last_message = 'Usuário e/ou senha incorretos!';
- $this->notify();
- header('Location: '.URL_ROOT.'login.php');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement