public function loadModel($id) { $model = Webconfig::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
/** * Настройки сайта * @throws CHttpException */ public function actionWebsettings() { // Проверяем права пользователя if (!Webadmins::checkAccess('websettings_view')) { throw new CHttpException(403, "У Вас недостаточно прав"); } // Вытаскиваем модель $model = Webconfig::getCfg(); $themes = array(); // Ищем папки тем в themes foreach (glob(ROOTPATH . '/themes/*') as $t) { $themes[basename($t)] = basename($t); } if (isset($_POST['Webconfig'])) { if (!Webadmins::checkAccess('websettings_edit')) { throw new CHttpException(403, "У Вас недостаточно прав"); } $model->attributes = $_POST['Webconfig']; if ($model->save()) { $this->redirect(array('websettings')); } } $this->render('websettings', array('model' => $model, 'themes' => $themes)); }
public function init() { $this->data = Webconfig::getCfg(); parent::init(); }
/** * @des */ public function action_feedback() { $userName = Webconfig::getConfig('cfg_sms_username'); $password = WebConfig::getConfig('cfg_sms_password'); $password = empty($password) ? '' : md5($password); $url = "http://www.stourweb.com/user/login/do_user_login/account/{$userName}/password/{$password}"; echo '<script>' . 'window.open("' . $url . '","_self")' . '</script>'; }