public function loadModel($id)
 {
     $model = Webconfig::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemple #2
0
 /**
  * Настройки сайта
  * @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));
 }
Exemple #3
0
 public function init()
 {
     $this->data = Webconfig::getCfg();
     parent::init();
 }
Exemple #4
0
 /**
  * @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>';
 }