Advertisement
Guest User

Untitled

a guest
Dec 20th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public function checklogin()
  2. {
  3. $app = Slim::getInstance();
  4. $val = $app->request()->post();
  5.  
  6. $pseudo = filter_var($val['identifiant'], FILTER_SANITIZE_STRING);
  7. $pass = filter_var($val['password'], FILTER_SANITIZE_STRING);
  8.  
  9. $u = User::where("identifiant", "like", $pseudo)->first();
  10. $hash = $u->password;
  11. //$tmp=password_hash($pass, PASSWORD_DEFAULT );
  12. if (password_verify($pass, $hash)) {
  13. $_SESSION['id'] = $u->id;
  14. }
  15. $app->redirect($app->urlFor('homeadmin'));
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement