aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-01-05 06:31:32 +0100
committerGitHub <noreply@github.com>2023-01-05 06:31:32 +0100
commit4670c5b38fe43edf3d4be090e693dd3c22a6aebb (patch)
tree3fa28e564fb10573f4af3e58037f3d4e08eb4be6 /apps
parent411754a12a5ac6ab244688e4910987af9f0287cd (diff)
parentb4a29644ccfc1acafcfbdb8b7b887df1fe520166 (diff)
downloadnextcloud-server-4670c5b38fe43edf3d4be090e693dd3c22a6aebb.tar.gz
nextcloud-server-4670c5b38fe43edf3d4be090e693dd3c22a6aebb.zip
Merge pull request #35981 from nextcloud/followup/35965/const-for-max-password-length
Add a const for the max user password length
Diffstat (limited to 'apps')
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php4
-rw-r--r--apps/settings/lib/Controller/ChangePasswordController.php4
2 files changed, 4 insertions, 4 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php
index 434912f32aa..97d66acd2e0 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -389,7 +389,7 @@ class UsersController extends AUserData {
}
$generatePasswordResetToken = false;
- if (strlen($password) > 469) {
+ if (strlen($password) > IUserManager::MAX_PASSWORD_LENGTH) {
throw new OCSException('Invalid password value', 101);
}
if ($password === '') {
@@ -889,7 +889,7 @@ class UsersController extends AUserData {
break;
case self::USER_FIELD_PASSWORD:
try {
- if (strlen($value) > 469) {
+ if (strlen($value) > IUserManager::MAX_PASSWORD_LENGTH) {
throw new OCSException('Invalid password value', 102);
}
if (!$targetUser->canChangePassword()) {
diff --git a/apps/settings/lib/Controller/ChangePasswordController.php b/apps/settings/lib/Controller/ChangePasswordController.php
index a25f0b0e59b..20ec28220a5 100644
--- a/apps/settings/lib/Controller/ChangePasswordController.php
+++ b/apps/settings/lib/Controller/ChangePasswordController.php
@@ -95,7 +95,7 @@ class ChangePasswordController extends Controller {
}
try {
- if ($newpassword === null || strlen($newpassword) > 469 || $user->setPassword($newpassword) === false) {
+ if ($newpassword === null || strlen($newpassword) > IUserManager::MAX_PASSWORD_LENGTH || $user->setPassword($newpassword) === false) {
return new JSONResponse([
'status' => 'error',
'data' => [
@@ -146,7 +146,7 @@ class ChangePasswordController extends Controller {
]);
}
- if (strlen($password) > 469) {
+ if (strlen($password) > IUserManager::MAX_PASSWORD_LENGTH) {
return new JSONResponse([
'status' => 'error',
'data' => [