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']]; }
/** * Список всех строк для обновления таблицы. */ public function actionRows() { $this->renderJson('_rows', array('data' => SettingsModel::getSettings())); }
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; }
public function set($name, $value) { $result = SettingsModel::setSetting($name, $value); $this->param = $this->getAllSettings(); return $result; }