06.05
php
saved
stevieboy
Note
app_controller.php has to be changed
app_controller.php has to be changed
- /* SVN FILE: $Id: app_controller.php,v 1.2 2007-11-20 22:56:49 stefan.hoth Exp $ */
- /**
- * Short description for file.
- *
- * This file is application-wide controller file. You can put all
- * application-wide controller-related methods here.
- *
- * PHP versions 4 and 5
- *
- * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
- * Copyright 2005-2007, Cake Software Foundation, Inc.
- * 1785 E. Sahara Avenue, Suite 490-204
- * Las Vegas, Nevada 89104
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @filesource
- * @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
- * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
- * @package cake
- * @subpackage cake.app
- * @since CakePHP(tm) v 0.2.9
- * @version $Revision: 1.2 $
- * @modifiedby $LastChangedBy: phpnut $
- * @lastmodified $Date: 2007-11-20 22:56:49 $
- * @license http://www.opensource.org/licenses/mit-license.php The MIT License
- */
- /**
- * Short description for class.
- *
- * Add your application-wide methods in the class below, your controllers
- * will inherit them.
- *
- * @package cake
- * @subpackage cake.app
- */
- class AppController extends Controller {
- // check login state for all users using an admin-url
- function beforeFilter(){
- $this->getNamedArgs();
- $this->checkSession();
- }
- }
- //checks login state and
- function checkSession()
- {
- // If the session info hasn't been set...
- if (!$this->Session->check('User'))
- {
- $this->Session->write('returnPath', $_SERVER['REQUEST_URI']);
- // Force the user to login
- $this->redirect('/users/login/');
- }
- }
- }
Parsed in 0.034 seconds, using GeSHi 1.0.7.14