05.04 php saved
UserLogin
Tags add more
auth  
Note
UserLogin did not leave a note
  1. <?php
  2. class UsersController extends AppController {
  3.  
  4.     var $name = 'Users';
  5.     var $helpers = array('Html', 'Form');
  6.     var $components = array('Auth');
  7.  
  8.     function login()
  9.     {
  10.         $this->log('First line in User::login()');
  11.         if(!empty($this->data)) {
  12.             $this->log('After 1st if in User::login()');
  13.             if($this->Auth->login($this->data)) {
  14.                 $this->log('After 2nd if in User::login()');
  15.                 $this->User->id = $this->Session->read('Auth.User.id');
  16.                 $this->User->saveField('last_login', date('Y-m-d H:i:s'));
  17.             }
  18.         }
  19.         $this->log('Last line in User::login()');
  20.     }
  21.  
  22.     function logout(){
  23.         $this->redirect($this->Auth->logout());
  24.     }
  25. }
  26. ?>
Parsed in 0.046 seconds, using GeSHi 1.0.7.14

Modify this Paste