05.20
php
saved
paulherron
Note
paulherron did not leave a note
paulherron did not leave a note
- // Code for your AppController. $this->Auth->userScope() is used to say that only the user with the username of 'admin' should be able to log in.
- <?php
- class AppController extends Controller
- {
- function beforeFilter() {
- $this->Auth->authorize = 'controller';
- }
- function isAuthorized() {
- return true;
- }
- }
- ?>
- // Then, in the relevant controllers, use $this->Auth->deny() to declare the actions that require a login.
- <?php
- class ArticlesController extends AppController {
- function beforeFilter() {
- $this->Auth->deny('admin_index');
- parent::beforeFilter();
- }
- }
- ?>
Parsed in 0.027 seconds, using GeSHi 1.0.7.14