/** * Initialises this controller, does some basic checks and setups * * @access protected * @return void */ protected function _init() { parent::_init(); $updatelastcheck = Yii::app()->getConfig('updatelastcheck'); $this->_sessioncontrol(); if (Yii::app()->getConfig('buildnumber') != "" && Yii::app()->getConfig('updatecheckperiod') > 0 && $updatelastcheck < dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", "-" . Yii::app()->getConfig('updatecheckperiod') . " days")) { updateCheck(); } unset(Yii::app()->session['FileManagerContext']); if (!Yii::app()->getConfig("surveyid")) { Yii::app()->setConfig("surveyid", returnGlobal('sid')); } //SurveyID if (!Yii::app()->getConfig("ugid")) { Yii::app()->setConfig("ugid", returnGlobal('ugid')); } //Usergroup-ID if (!Yii::app()->getConfig("gid")) { Yii::app()->setConfig("gid", returnGlobal('gid')); } //GroupID if (!Yii::app()->getConfig("qid")) { Yii::app()->setConfig("qid", returnGlobal('qid')); } //QuestionID if (!Yii::app()->getConfig("lid")) { Yii::app()->setConfig("lid", returnGlobal('lid')); } //LabelID if (!Yii::app()->getConfig("code")) { Yii::app()->setConfig("code", returnGlobal('code')); } // ?? if (!Yii::app()->getConfig("action")) { Yii::app()->setConfig("action", returnGlobal('action')); } //Desired action if (!Yii::app()->getConfig("subaction")) { Yii::app()->setConfig("subaction", returnGlobal('subaction')); } //Desired subaction if (!Yii::app()->getConfig("editedaction")) { Yii::app()->setConfig("editedaction", returnGlobal('editedaction')); } // for html editor integration }
/** * Initialises this controller, does some basic checks and setups * * @access protected * @return void */ protected function _init() { parent::_init(); unset(Yii::app()->session['FileManagerContext']); if (!Yii::app()->getConfig("surveyid")) { Yii::app()->setConfig("surveyid", returnGlobal('sid')); } //SurveyID if (!Yii::app()->getConfig("ugid")) { Yii::app()->setConfig("ugid", returnGlobal('ugid')); } //Usergroup-ID if (!Yii::app()->getConfig("gid")) { Yii::app()->setConfig("gid", returnGlobal('gid')); } //GroupID if (!Yii::app()->getConfig("qid")) { Yii::app()->setConfig("qid", returnGlobal('qid')); } //QuestionID if (!Yii::app()->getConfig("lid")) { Yii::app()->setConfig("lid", returnGlobal('lid')); } //LabelID if (!Yii::app()->getConfig("code")) { Yii::app()->setConfig("code", returnGlobal('code')); } // ?? if (!Yii::app()->getConfig("action")) { Yii::app()->setConfig("action", returnGlobal('action')); } //Desired action if (!Yii::app()->getConfig("subaction")) { Yii::app()->setConfig("subaction", returnGlobal('subaction')); } //Desired subaction if (!Yii::app()->getConfig("editedaction")) { Yii::app()->setConfig("editedaction", returnGlobal('editedaction')); } // for html editor integration Yii::app()->clientScript->registerPackage('decimal'); // decimal }
public function run($action) { return parent::run($action); }
/** * Checks for action specific authorization and then executes an action * * @access public * @param string $action * @return bool */ public function run($action) { // Check if the DB is up to date if (Yii::app()->db->schema->getTable('{{surveys}}')) { $usrow = getGlobalSetting('DBVersion'); if ((int) $usrow < Yii::app()->getConfig('dbversionnumber') && $action != 'update' && $action != 'authentication') { $this->redirect($this->createUrl('/admin/update/db')); } } if ($action != "update" && $action != "db") { if (empty($this->user_id) && $action != "authentication" && $action != "remotecontrol") { if (!empty($action) && $action != 'index') { Yii::app()->session['redirect_after_login'] = $this->createUrl('/'); } Yii::app()->session['redirectopage'] = Yii::app()->request->requestUri; $this->redirect($this->createUrl('/admin/authentication/login')); } } return parent::run($action); }
/** * @todo Doc */ public function filters() { $aFilters = array('accessControl'); return array_merge(parent::filters(), $aFilters); }
/** * Checks for action specific authorization and then executes an action * * @access public * @param string $action * @return bool */ public function run($action) { // Check if the DB is up to date if (Yii::app()->db->schema->getTable('{{surveys}}')) { $sDBVersion = getGlobalSetting('DBVersion'); if ((int) $sDBVersion < Yii::app()->getConfig('dbversionnumber') && $action != 'update' && $action != 'authentication') { $this->redirect(array('/admin/update/sa/db')); } } if ($action != "update" && $action != "db") { if (empty($this->user_id) && $action != "authentication" && $action != "remotecontrol") { if (!empty($action) && $action != 'index') { Yii::app()->session['redirect_after_login'] = $this->createUrl('/'); } //App()->user->setReturnUrl(App()->request->requestUri); $this->redirect(array('/admin/authentication/sa/login')); } elseif (!empty($this->user_id) && $action != "remotecontrol") { if (Yii::app()->session['session_hash'] != hash('sha256', getGlobalSetting('SessionName') . Yii::app()->user->getName() . Yii::app()->user->getId())) { Yii::app()->session->clear(); Yii::app()->session->close(); $this->redirect(array('/admin/authentication/sa/login')); } } } return parent::run($action); }
/** * Checks for action specific authorization and then executes an action * * @access public * @param string $action * @return bool */ public function run($action) { // Check if the DB is up to date if (empty($this->pnl_id) && $action != "authentication" && $action != "registration" && $action != "remotecontrol") { if (!empty($action) && $action != 'index') { Yii::app()->session['redirect_after_login'] = $this->createUrl('/'); } //App()->user->setReturnUrl(App()->request->requestUri); $this->redirect(array('/pl/authentication/sa/login')); } elseif (!empty($this->pnl_id) && $action != "remotecontrol") { if (Yii::app()->session['session_hash'] != hash('sha256', getGlobalSetting('SessionName') . Yii::app()->session['pluser'] . Yii::app()->session['plid'])) { Yii::app()->session->clear(); Yii::app()->session->close(); $this->redirect(array('/pl/authentication/sa/login')); } } return parent::run($action); }