Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allowing email for password recovery #27168
The function sendEmail in core/LostController.php was checking if a user with the given name exists or not. What I did is, in the else condition used the function getByEmail() and checked if the count of users is 0, 1 or else. In the first case, the following error was logged
and in the third case
A recovery mail was sent only when the count of email was singular in this case.
Motivation and Context
It solves the problem raised in issue: #27111
How Has This Been Tested?
I forked and clone the repository in my VPS and tested their with all the changes. Recovery mails were received by providing either username or an email address(unique) associated to that user. If a recovery mail was requested for an incorrect username(non existing) or for an email address that was not unique, proper error messages were logged and check in the core/owncloud.log file.
Types of changes
Hey @imujjwal96 thanks for the PR! Just checking out the code, we're introducing a fair bit of duplicated code here. Perhaps you could alter this to either find the user by name, or by email, and once you have the user, pass that to the code that sends the email.
So maybe it should be like this:
Feb 27, 2017
Added to feature list for 10.0: https://github.com/owncloud/core/wiki/ownCloud-10.0-Features