Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isset($this->params[Configure::read('Routing.admin')])) { //User is trying to access a page using the admin route
- if ($this->Session->check('someSessionVariable')) { //Check user has some session variable set.
- // User is accessing an admin page and has permission, do something, or in most cases do nothing.
- } else { //No sessions set for user, redirect to login page.
- $this->redirect('/yourLoginPage'); //Redirect
- }
- }
Add Comment
Please, Sign In to add comment