deleted useless comments from routes
[qcms.git] / app_controller.php
blob57777fbd1e701c9bf46584ee4e1ee5f722c2884b
1 <?php
2 class AppController extends Controller {
4 var $components = array('RequestHandler', 'Auth');
5 var $helpers = array('Html', 'Form');
7 var $allowedActions = array();
9 function beforeFilter() {
10 Configure::write('Config.language', 'en');
12 if (Configure::read('debug') > 1) {
13 if ($this->RequestHandler->isAjax()) {
14 Configure::write('ajaxdebug', 1);
18 $this->_setupAuth();
21 function _setupAuth() {
22 if ($this->Auth) {
23 if (Configure::read('Settings.auth.enabled')) {
25 $availableOptions = array_keys(get_object_vars($this->Auth));
26 $options = Configure::read('Settings.auth.options');
28 foreach ($options as $option => $value) {
29 if (in_array($option, $availableOptions)) {
30 $this->Auth->$option = $value;
34 if (!empty($this->allowedActions)) {
35 $this->Auth->allow($this->allowedActions);
38 } else {
39 $this->Auth->allow();
44 function isAuthorized() {
45 return true;