Changes between Version 7 and Version 8 of GuardPlugin


Ignore:
Timestamp:
2012-05-11T00:29:08Z (12 years ago)
Author:
Pan Luo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GuardPlugin

    v7 v8  
    114114 * Now CakePHP will render your template or elements instead of default ones
    115115
     116== Doing Stuff After User login ==
     117
     118To do stuff after login, make sure the route /login is in the app/config/routes.php
     119{{{
     120#!php
     121Router::connect('/login', array('controller' => 'users', 'action' => 'login'));
     122}}}
     123
     124Disable the autoRedirect in app_controller.php
     125{{{
     126#!php
     127public function beforeFilter()
     128{
     129    $this->Auth->autoRedirect = false;
     130     .....
     131}
     132}}}
     133
     134Create a login action in users controller (the controller and action can be change by changing the value in the route created above:
     135{{{
     136#!php
     137class UsersController extends AppController
     138{
     139    .....
     140    function login()
     141    {
     142         if ($this->Auth->isAuthorized()) {
     143              // after login stuff
     144         }   
     145    }
     146}
     147}}}
    116148
    117149== Developing New Module ==