Skip to content
Permalink
Browse files

Merge branch 'develop-v2' of github.com:craftcms/cms into develop

# Conflicts:
#	src/controllers/UsersController.php
  • Loading branch information...
brandonkelly committed Dec 12, 2018
2 parents 5fda444 + 2e2f474 commit 71b8848ca0884580c9998760bbd597b16d38cc0d
Showing with 14 additions and 4 deletions.
  1. +2 −0 CHANGELOG-v2.md
  2. +12 −4 src/controllers/UsersController.php
@@ -5,6 +5,8 @@
### Fixed
- Fixed a SQL error that could occur when merging two elements together if MySQL was set to a case-sensitive collation. ([#3539](https://github.com/craftcms/cms/issues/3539))
- Fixed a bug where element indexes wouldn’t return to the previous sort selection after the search input was cleared. ([#3548](https://github.com/craftcms/cms/issues/3548))
- Fixed a bug where password-reset email send errors weren’t being properly reported on the login page if the `preventUserEnumeration` config setting was enabled.
- Fixed a bug where Edit User pages weren’t reporting email send errors when the “Send password reset email” option was chosen. ([#3549](https://github.com/craftcms/cms/issues/3549))

## 2.7.4 - 2018-11-27

@@ -309,6 +309,11 @@ public function actionSendPasswordResetEmail()
}
}
// If no one is logged in and preventUserEnumeration is enabled, clear out the login errors
if (!$existingUser && Craft::$app->getConfig()->getGeneral()->preventUserEnumeration) {
$errors = [];
}
if (!empty($user)) {
try {
$emailSent = Craft::$app->getUsers()->sendPasswordResetEmail($user);
@@ -321,9 +326,7 @@ public function actionSendPasswordResetEmail()
}
}
// If there haven't been any errors, or there were, and it's not one logged in user editing another
// and we want to pretend like there wasn't any errors...
if (empty($errors) || (count($errors) > 0 && !$existingUser && Craft::$app->getConfig()->getGeneral()->preventUserEnumeration)) {
if (empty($errors)) {
if (Craft::$app->getRequest()->getAcceptsJson()) {
return $this->asJson(['success' => true]);
}
@@ -511,12 +514,17 @@ public function actionActivateUser(): Response
*
* @param int|string|null $userId The user’s ID, if any, or a string that indicates the user to be edited ('current' or 'client').
* @param User|null $user The user being edited, if there were any validation errors.
* @param array|null $errors Any errors that occurred as a result of the previous action.
* @return Response
* @throws NotFoundHttpException if the requested user cannot be found
* @throws BadRequestHttpException if there’s a mismatch between|null $userId and|null $user
*/
public function actionEditUser($userId = null, User $user = null): Response
public function actionEditUser($userId = null, User $user = null, array $errors = null): Response
{
if (!empty($errors)) {
Craft::$app->getSession()->setError(reset($errors));
}
// Determine which user account we're editing
// ---------------------------------------------------------------------

0 comments on commit 71b8848

Please sign in to comment.
You can’t perform that action at this time.