| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 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 |
|
|---|
| 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 |
|
|---|