コード例 #1
0
 private static function users()
 {
     if (Yii::$app->controller->module->password_in_settings) {
         $password = SettingsModel::getSetting('password');
     } else {
         $password = Yii::$app->controller->module->password;
     }
     return ['1001' => ['id' => '1001', 'username' => self::DEFAULT_USERNAME, 'password' => $password, 'authKey' => 'test100key1', 'accessToken' => '100-token1']];
 }
コード例 #2
0
 /**
  * Список всех строк для обновления таблицы.
  */
 public function actionRows()
 {
     $this->renderJson('_rows', array('data' => SettingsModel::getSettings()));
 }
コード例 #3
0
 public function is_password_required()
 {
     if (Yii::$app->controller->id == 'site') {
         return false;
     }
     if (!$this->password_in_settings and empty($this->password)) {
         return false;
     } else {
         if ($this->password_in_settings) {
             $pass = SettingsModel::getSetting('password');
             if (empty($pass)) {
                 return false;
             }
         }
     }
     return true;
 }
コード例 #4
0
 public function set($name, $value)
 {
     $result = SettingsModel::setSetting($name, $value);
     $this->param = $this->getAllSettings();
     return $result;
 }