Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AppController extends Controller {
- var $components = array('Auth', 'Session');
- var $helpers = array('Form');
- }`
- class UsersController extends AppController {
- var $name = 'Users';
- var $components = array('Auth');
- function login()
- {
- }
- function logout()
- {
- $this->redirect($this->Auth->logout());
- }
- }
- <?php
- echo $this->Session->flash('auth');
- echo $this->Form->create('User');
- echo $this->Form->input('username');
- echo $this->Form->input('password');
- echo $this->Form->end('Login');
- ?>
- public function login() {
- if ($this->Auth->login()) {
- $this->redirect($this->Auth->redirect());
- }
- }
Add Comment
Please, Sign In to add comment