diff --git a/protected/humhub/modules/admin/controllers/UserController.php b/protected/humhub/modules/admin/controllers/UserController.php index d69c5245a5..e345e1177c 100644 --- a/protected/humhub/modules/admin/controllers/UserController.php +++ b/protected/humhub/modules/admin/controllers/UserController.php @@ -111,7 +111,7 @@ class UserController extends Controller $canEditAdminFields = Yii::$app->user->isAdmin() || !$user->isSystemAdmin(); $canEditPassword = $canEditAdminFields && $authClientUserService->canChangePassword(); - $user->scenario = 'editAdmin'; + $user->scenario = User::SCENARIO_EDIT_ADMIN; $user->profile->scenario = Profile::SCENARIO_EDIT_ADMIN; $profile = $user->profile; diff --git a/protected/humhub/modules/admin/models/forms/UserEditForm.php b/protected/humhub/modules/admin/models/forms/UserEditForm.php index 78418f6988..ce5689a37b 100644 --- a/protected/humhub/modules/admin/models/forms/UserEditForm.php +++ b/protected/humhub/modules/admin/models/forms/UserEditForm.php @@ -46,7 +46,7 @@ class UserEditForm extends User public function scenarios() { $scenarios = parent::scenarios(); - $scenarios['editAdmin'][] = 'groupSelection'; + $scenarios[static::SCENARIO_EDIT_ADMIN][] = 'groupSelection'; return $scenarios; } diff --git a/protected/humhub/modules/user/models/User.php b/protected/humhub/modules/user/models/User.php index c40ccdd89a..b3ccfe0ca3 100644 --- a/protected/humhub/modules/user/models/User.php +++ b/protected/humhub/modules/user/models/User.php @@ -160,18 +160,18 @@ class User extends ContentContainerActiveRecord implements IdentityInterface, Se }], [['created_by', 'updated_by'], 'integer'], [['status'], 'in', 'range' => array_keys(self::getStatusOptions())], - [['visibility'], 'in', 'range' => array_keys(self::getVisibilityOptions()), 'on' => Profile::SCENARIO_EDIT_ADMIN], + [['visibility'], 'in', 'range' => array_keys(self::getVisibilityOptions()), 'on' => static::SCENARIO_EDIT_ADMIN], [['tagsField', 'blockedUsersField'], 'safe'], [['guid'], 'string', 'max' => 45], [['time_zone'], 'validateTimeZone'], [['auth_mode'], 'string', 'max' => 10], [['language'], 'string', 'max' => 5], - ['language', 'in', 'range' => array_keys(Yii::$app->i18n->getAllowedLanguages()), 'except' => self::SCENARIO_APPROVE], + ['language', 'in', 'range' => array_keys(Yii::$app->i18n->getAllowedLanguages()), 'except' => static::SCENARIO_APPROVE], [['email'], 'unique'], [['email'], 'email'], [['email'], 'string', 'max' => 150], [['guid'], 'unique'], - [['username'], 'validateForbiddenUsername', 'on' => [self::SCENARIO_REGISTRATION]], + [['username'], 'validateForbiddenUsername', 'on' => [static::SCENARIO_REGISTRATION]], ]; if ($this->isEmailRequired()) { // HForm does not support 'required' in combination with 'when'.