mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #59069 from nextcloud/backport/59064/stable26
Some checks are pending
Cypress / init (push) Waiting to run
Cypress / runner 1 (push) Blocked by required conditions
Cypress / runner 2 (push) Blocked by required conditions
Cypress / runner component (push) Blocked by required conditions
Cypress / cypress-summary (push) Blocked by required conditions
Lint eslint / eslint (push) Waiting to run
Lint php / php-lint (push) Waiting to run
Lint php / php-lint-summary (push) Blocked by required conditions
Node / versions (push) Waiting to run
Node / test (push) Blocked by required conditions
Node / jsunit (push) Blocked by required conditions
Node / handlebars (push) Blocked by required conditions
Node / node (push) Waiting to run
S3 primary storage integration tests / php8.0-objectstore-minio (push) Waiting to run
S3 primary storage integration tests / php8.0-objectstore_multibucket-minio (push) Waiting to run
S3 primary storage integration tests / s3-primary-integration-summary (push) Blocked by required conditions
S3 primary storage / php8.0-objectstore-minio (push) Waiting to run
S3 primary storage / php8.0-objectstore_multibucket-minio (push) Waiting to run
S3 primary storage / s3-primary-summary (push) Blocked by required conditions
Psalm static code analysis / static-code-analysis (push) Waiting to run
Psalm static code analysis / static-code-analysis-security (push) Waiting to run
Psalm static code analysis / static-code-analysis-ocp (push) Waiting to run
Some checks are pending
Cypress / init (push) Waiting to run
Cypress / runner 1 (push) Blocked by required conditions
Cypress / runner 2 (push) Blocked by required conditions
Cypress / runner component (push) Blocked by required conditions
Cypress / cypress-summary (push) Blocked by required conditions
Lint eslint / eslint (push) Waiting to run
Lint php / php-lint (push) Waiting to run
Lint php / php-lint-summary (push) Blocked by required conditions
Node / versions (push) Waiting to run
Node / test (push) Blocked by required conditions
Node / jsunit (push) Blocked by required conditions
Node / handlebars (push) Blocked by required conditions
Node / node (push) Waiting to run
S3 primary storage integration tests / php8.0-objectstore-minio (push) Waiting to run
S3 primary storage integration tests / php8.0-objectstore_multibucket-minio (push) Waiting to run
S3 primary storage integration tests / s3-primary-integration-summary (push) Blocked by required conditions
S3 primary storage / php8.0-objectstore-minio (push) Waiting to run
S3 primary storage / php8.0-objectstore_multibucket-minio (push) Waiting to run
S3 primary storage / s3-primary-summary (push) Blocked by required conditions
Psalm static code analysis / static-code-analysis (push) Waiting to run
Psalm static code analysis / static-code-analysis-security (push) Waiting to run
Psalm static code analysis / static-code-analysis-ocp (push) Waiting to run
This commit is contained in:
commit
816273d035
1 changed files with 7 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Roger Szabo <roger.szabo@web.de>
|
||||
*
|
||||
|
|
@ -120,6 +121,7 @@ class RenewPasswordController extends Controller {
|
|||
/**
|
||||
* @PublicPage
|
||||
* @UseSession
|
||||
* @BruteForceProtection(action=login)
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $oldPassword
|
||||
|
|
@ -131,19 +133,21 @@ class RenewPasswordController extends Controller {
|
|||
if ($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') {
|
||||
return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm'));
|
||||
}
|
||||
$args = !is_null($user) ? ['user' => $user] : [];
|
||||
$args = ['user' => $user];
|
||||
$loginResult = $this->userManager->checkPassword($user, $oldPassword);
|
||||
if ($loginResult === false) {
|
||||
$this->session->set('renewPasswordMessages', [
|
||||
['invalidpassword'], []
|
||||
]);
|
||||
return new RedirectResponse($this->urlGenerator->linkToRoute('user_ldap.renewPassword.showRenewPasswordForm', $args));
|
||||
$response = new RedirectResponse($this->urlGenerator->linkToRoute('user_ldap.renewPassword.showRenewPasswordForm', $args));
|
||||
$response->throttle(['user' => $user]);
|
||||
return $response;
|
||||
}
|
||||
|
||||
try {
|
||||
if (!is_null($newPassword) && \OC_User::setPassword($user, $newPassword)) {
|
||||
$this->session->set('loginMessages', [
|
||||
[], [$this->l10n->t("Please login with the new password")]
|
||||
[], [$this->l10n->t('Please login with the new password')]
|
||||
]);
|
||||
$this->config->setUserValue($user, 'user_ldap', 'needsPasswordReset', 'false');
|
||||
return new RedirectResponse($this->urlGenerator->linkToRoute('core.login.showLoginForm', $args));
|
||||
|
|
|
|||
Loading…
Reference in a new issue