Guest User

Untitled

a guest
Dec 14th, 2017
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. <?php
  2. $userEmail = 'test@test.com';
  3. $userPassword = '123456';
  4.  
  5. // Using Doctrine for example
  6. $user = $repository->findByEmail($userEmail);
  7.  
  8. if(!$user) {
  9. // User not found
  10. // LOGIN ERROR
  11. }
  12.  
  13. if(md5($userPassword) == $user->getPassword()) {
  14. // DO LOGIN
  15. }
  16. // LOGIN ERROR
Add Comment
Please, Sign In to add comment