Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
12345 anikendra 1
<?php
2
/**
3
 * Application level Controller
4
 *
5
 * This file is application-wide controller file. You can put all
6
 * application-wide controller-related methods here.
7
 *
8
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
9
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
10
 *
11
 * Licensed under The MIT License
12
 * For full copyright and license information, please see the LICENSE.txt
13
 * Redistributions of files must retain the above copyright notice.
14
 *
15
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
16
 * @link          http://cakephp.org CakePHP(tm) Project
17
 * @package       app.Controller
18
 * @since         CakePHP(tm) v 0.2.9
19
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
20
 */
21
 
22
App::uses('Controller', 'Controller');
23
 
24
/**
25
 * Application Controller
26
 *
27
 * Add your application-wide methods in the class below, your controllers
28
 * will inherit them.
29
 *
30
 * @package		app.Controller
31
 * @link		http://book.cakephp.org/2.0/en/controllers.html#the-app-controller
32
 */
33
class AppController extends Controller {
34
	public $components = array('DebugKit.Toolbar','Session',
35
						'Auth' => array(
36
	//                      'authorize' => array('Controller'),
37
	                        'loginAction' => array('controller' => 'users', 'action' => 'login'),
38
	                        'allowedActions' => array('index', 'view', 'display')
39
	                	)
40
					);
41
 
42
	public $helpers = array('Session','BootstrapCake.Bootstrap');
43
 
44
	function beforeFilter() {
45
		$this->set('logged_user', $this->Auth->user());
46
		$this->layout = 'bootstrap';		
47
	}
48
 
49
	function beforeRender() {
50
        $this->set('base_url', 'http://' . $_SERVER['SERVER_NAME'] . Router::url('/'));
51
    }
52
}