Skip to content

Instantly share code, notes, and snippets.

@pedroelsner
Created May 24, 2012 02:33
Show Gist options
  • Save pedroelsner/2779102 to your computer and use it in GitHub Desktop.
Save pedroelsner/2779102 to your computer and use it in GitHub Desktop.
#2 User.php - CakePHP 1.3 + AuthComponent
<?php
/**
* Login
*
* @access public
*/
function login()
{
// Aqui é tudo automagic.
// O Auth Component se encarrega de fazer tudo sozinho.
}
/**
* Logout
*
* @access public
*/
function logout()
{
$this->Session->setFlash(__('Sua sessão foi encerrada.', true));
$this->redirect($this->Auth->logout());
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment