01.30
php
saved
Baz
Note
AuthComponent issues
login and logout can't be part of the allowed list.
AuthComponent issues
login and logout can't be part of the allowed list.
- // ==========================================================
- // ==========================================================
- // ==========================================================
- // ==========================================================
- class AppController extends Controller {
- function beforeFilter() {
- //debug($this->Auth);
- //debug($this->Session);
- if (@$this->params['prefix'] == "admin") {
- $this->layout = "admin";
- $this->set("prefix", "admin_");
- } else {
- $this->set("prefix", "");
- }
- $this->Auth->allow(
- 'display',
- 'index',
- 'view',
- 'login',
- 'logout',
- 'latest');
- $this->Auth->authorize = 'controller';
- }
- }
- // ==========================================================
- // ==========================================================
- // ==========================================================
- // ==========================================================
- class UsersController extends AppController {
- var $name = 'Users';
- function login() {
- }
- function logout() {
- $this->Session->setFlash("Logged out");
- $this->redirect($this->Auth->logout());
- }
- // .... snip standard baked junk
- }
- // ==========================================================
- // ==========================================================
- // ==========================================================
- // ==========================================================
- class User extends AppModel {
- var $name = 'User';
- var $useTable = 'users';
- }
- // ==========================================================
- // ==========================================================
- // ==========================================================
- // ==========================================================
- // LOGIN.CTP EXTACT
- <table class="formTable">
- <tr>
- <th>username</th>
- </tr>
- <tr>
- <th>password</th>
- </tr>
- <tr>
- <td/>
- <td>
- <a href="#" onClick="javascript:document.loginForm.submit();">< login</a>
- </td>
- </tr>
- </table>
Parsed in 0.128 seconds, using GeSHi 1.0.7.14