Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. if ($this->request->is('post')) {
  2. $user = $this->Auth->identify();
  3.  
  4. if ($user) {
  5.  
  6. $this->Auth->setUser($user);
  7.  
  8. $this->request->session()->write('Usuario.id', $this->Auth->User('id'));
  9. $this->request->session()->write('Usuario.nome', $this->Auth->User('nome'));
  10. $this->request->session()->write('Usuario.grupo', $this->Auth->User('grupo_id'));
  11.  
  12. return $this->redirect($this->Auth->redirectUrl());
  13.  
  14. } else {
  15. $this->Flash->error(__('E-Mail ou senha está incorreta'),'default',[],'auth');
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement