Assembla home | Assembla project page
 

root/branch/app_controller.php

Revision 142, 3.6 kB (checked in by digitalspaghetti, 1 year ago)

--

  • Property svn:executable set to *
Line 
1 <?php
2 /* SVN FILE: $Id: app_controller.php 5118 2007-05-18 17:19:53Z phpnut $ */
3 /**
4  * Short description for file.
5  *
6  * This file is application-wide controller file. You can put all
7  * application-wide controller-related methods here.
8  *
9  * PHP versions 4 and 5
10  *
11  * CakePHP(tm) :  Rapid Development Framework <http://www.cakephp.org/>
12  * Copyright 2005-2007, Cake Software Foundation, Inc.
13  *                                1785 E. Sahara Avenue, Suite 490-204
14  *                                Las Vegas, Nevada 89104
15  *
16  * Licensed under The MIT License
17  * Redistributions of files must retain the above copyright notice.
18  *
19  * @filesource
20  * @copyright        Copyright 2005-2007, Cake Software Foundation, Inc.
21  * @link                http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
22  * @package            cake
23  * @subpackage        cake.app
24  * @since            CakePHP(tm) v 0.2.9
25  * @version            $Revision: 5118 $
26  * @modifiedby        $LastChangedBy: phpnut $
27  * @lastmodified    $Date: 2007-05-18 18:19:53 +0100 (Fri, 18 May 2007) $
28  * @license            http://www.opensource.org/licenses/mit-license.php The MIT License
29  */
30 /**
31  * Short description for class.
32  *
33  * Add your application-wide methods in the class below, your controllers
34  * will inherit them.
35  *
36  * @package        cake
37  * @subpackage    cake.app
38  */
39 class AppController extends Controller {
40     
41     var $helpers = array('othAuth','Cache','Form','Html','Javascript','Text','Number','Time','Tree','Webrocket');
42     var $components = array('othAuth','Conf','RequestHandler','Session','Nav','Openid');
43     var $othAuthRestrictions = array('add','edit','delete',CAKE_ADMIN);
44     var $publicControllers = array('pages');
45     var $level = 0;
46     
47     /**
48      *  Called before view
49     **/
50
51     function beforeFilter()
52     {
53         $auth_conf = array('mode' => 'oth', 'login_page' => '/users/login', 'logout_page' => '/users/logout', 'access_page' => '/', 'hashkey' => CAKE_SESSION_STRING, 'noaccess_page' => '/users/noaccess', 'strict_gid_check' => false, 'history_active' => true, 'login_limit' => true, 'gid_order' => 'DESC');
54         $this->othAuth->controller = &$this;
55         $this->othAuth->init($auth_conf);
56         $this->othAuth->check();
57         
58         $level_check = $this->othAuth->group('level');
59         if (!empty($level_check)) $this->level = $level_check;
60         
61         /* Not replaced ACL Yet*/
62         /*
63         if (isset($this->Auth)) {
64             $this->Auth->userScope = array('User.disabled' => 0);
65             $this->Auth->loginAction = '/users/login';
66             $this->Auth->loginRedirect = '/users/account';
67             $this->Auth->fields = array('username' => 'username', 'password' => 'passwd');
68             $this->Auth->authorize = 'actions';
69
70             if (in_array(low($this->params['controller']), $this->publicControllers)) {
71                 $this->Auth->allow();
72             }
73         }*/
74         
75         
76         $sitetheme = "default";
77         
78         $this->layout = $sitetheme;
79     }
80
81     function beforeRender()
82     {
83         $this->set('sitename', $this->Conf->get('general.sitename'));
84         $this->set('sitedesc', $this->Conf->get('general.sitedesc'));
85         $this->set('siteurl', $this->Conf->get('general.siteurl'));
86         $this->set('sitelogo', $this->Conf->get('general.sitelogo'));
87         $this->set('enable_comments', $this->Conf->get('general.enable_comments'));
88         $this->set('enable_captcha', $this->Conf->get('general.enable_captcha'));
89         $this->set('video_width', $this->Conf->get('video.width'));
90         $this->set('video_height', $this->Conf->get('video.height'));
91         $this->set('video_samplerate', $this->Conf->get('video.samplerate'));
92         $this->set('video_bitrate', $this->Conf->get('video.bitrate'));
93         $this->set('post_index_limit', $this->Conf->get('post.post_index_limit'));
94         $this->set('post_index_order', $this->Conf->get('post.post_index_order'));
95         $this->set('post_index_cachetime', $this->Conf->get('post.post_index_cachetime'));
96     }
97 }
98 ?>
99
Note: See TracBrowser for help on using the browser.