Guest User

Untitled

a guest
Jan 18th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. class AppController extends Controller {
  2.  
  3. var $components = array('Auth', 'Session');
  4. var $helpers = array('Form');
  5.  
  6.  
  7.  
  8.  
  9. }`
  10.  
  11. class UsersController extends AppController {
  12. var $name = 'Users';
  13. var $components = array('Auth');
  14.  
  15. function login()
  16. {
  17.  
  18. }
  19. function logout()
  20. {
  21. $this->redirect($this->Auth->logout());
  22. }
  23. }
  24.  
  25. <?php
  26. echo $this->Session->flash('auth');
  27. echo $this->Form->create('User');
  28. echo $this->Form->input('username');
  29. echo $this->Form->input('password');
  30. echo $this->Form->end('Login');
  31. ?>
  32.  
  33. public function login() {
  34. if ($this->Auth->login()) {
  35. $this->redirect($this->Auth->redirect());
  36. }
  37. }
Add Comment
Please, Sign In to add comment