| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
class AppController extends Controller |
|---|
| 4 |
{ |
|---|
| 5 |
var $helpers = array('Cache','Form','Habtm','Html','Javascript','othAuth','Text','Time','TreeMenu', 'Xspf'); |
|---|
| 6 |
var $components = array('Captcha','Conf','Ffmpeg','FileOps','Openid','othAuth','RequestHandler','Session','YahooGeo'); |
|---|
| 7 |
var $othAuthRestrictions = array('add','edit','delete',CAKE_ADMIN); |
|---|
| 8 |
|
|---|
| 9 |
var $level = 0; |
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
* Called before view |
|---|
| 13 |
**/ |
|---|
| 14 |
|
|---|
| 15 |
function beforeFilter() |
|---|
| 16 |
{ |
|---|
| 17 |
$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'); |
|---|
| 18 |
$this->othAuth->controller = &$this; |
|---|
| 19 |
$this->othAuth->init($auth_conf); |
|---|
| 20 |
$this->othAuth->check(); |
|---|
| 21 |
|
|---|
| 22 |
$level_check = $this->othAuth->group('level'); |
|---|
| 23 |
if (!empty($level_check)) $this->level = $level_check; |
|---|
| 24 |
} |
|---|
| 25 |
|
|---|
| 26 |
function beforeRender() |
|---|
| 27 |
{ |
|---|
| 28 |
$this->set('sitename', $this->Conf->get('general.sitename')); |
|---|
| 29 |
$this->set('sitedesc', $this->Conf->get('general.sitedesc')); |
|---|
| 30 |
$this->set('siteurl', $this->Conf->get('general.siteurl')); |
|---|
| 31 |
$this->set('sitelogo', $this->Conf->get('general.sitelogo')); |
|---|
| 32 |
$this->set('enable_comments', $this->Conf->get('general.enable_comments')); |
|---|
| 33 |
$this->set('enable_captcha', $this->Conf->get('general.enable_captcha')); |
|---|
| 34 |
$this->set('video_width', $this->Conf->get('video.width')); |
|---|
| 35 |
$this->set('video_height', $this->Conf->get('video.height')); |
|---|
| 36 |
$this->set('video_samplerate', $this->Conf->get('video.samplerate')); |
|---|
| 37 |
$this->set('video_bitrate', $this->Conf->get('video.bitrate')); |
|---|
| 38 |
$this->set('post_index_limit', $this->Conf->get('post.post_index_limit')); |
|---|
| 39 |
$this->set('post_index_order', $this->Conf->get('post.post_index_order')); |
|---|
| 40 |
$this->set('post_index_cachetime', $this->Conf->get('post.post_index_cachetime')); |
|---|
| 41 |
} |
|---|
| 42 |
|
|---|
| 43 |
function captcha() |
|---|
| 44 |
{ |
|---|
| 45 |
$this->Captcha->render(); |
|---|
| 46 |
} |
|---|
| 47 |
} |
|---|
| 48 |
?> |
|---|