Advertisement
Guest User

Untitled

a guest
May 28th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. <?php
  2. class UserController extends AppController {
  3.  
  4.     #var $scaffold;
  5.    
  6.     function login(){
  7.         if( $this->Auth->user() ){
  8.             $this->Session->setFlash('Welcome back ' . $this->Auth->user('username')); 
  9.             $this->redirect( $this->Auth->redirect() );
  10.         }
  11.     }
  12.    
  13.     function logout(){
  14.         $this->Session->setFlash('Come again ') ;  
  15.         $this->redirect( $this->Auth->logout() );
  16.            
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement