Fix password length limitation

Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
pull/34534/head
Joas Schilling 2 years ago committed by nextcloud-command
parent bd3c3c5439
commit 32f704be1a

@ -382,6 +382,9 @@ class UsersController extends AUserData {
}
$generatePasswordResetToken = false;
if (strlen($password) > 469) {
throw new OCSException('Invalid password value', 101);
}
if ($password === '') {
if ($email === '') {
throw new OCSException('To send a password link to the user an email address is required.', 108);
@ -827,6 +830,9 @@ class UsersController extends AUserData {
break;
case self::USER_FIELD_PASSWORD:
try {
if (strlen($value) > 469) {
throw new OCSException('Invalid password value', 102);
}
if (!$targetUser->canChangePassword()) {
throw new OCSException('Setting the password is not supported by the users backend', 103);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -56,6 +56,7 @@
ref="newuserpassword"
v-model="newUser.password"
:minlength="minPasswordLength"
:maxlength="469"
:placeholder="t('settings', 'Password')"
:required="newUser.mailAddress===''"
autocapitalize="none"

Loading…
Cancel
Save