Drupal by default sends Password Reset URL by mail to user's email id in password recovery mail, but Recovery Password modules makes it possible for Drupal to send any random password by email instead of URL to the user.

Recovery Password Module alters default Drupal password reset process and makes it possible to send the new password in recovery mail itself. In this case, when user clicks on forgot password providing valid username or email address, new password is generated randomly and is sent to the user email address.

Important: As of now Recovery Password Module overrides default Drupal behaviour for password recovery and hence the previous settings will not work once the module is enabled till it is disabled again. User tokens are available in this case also.

Warning !!! Once forgot password is clicked for a user, the password gets changed for that user immediately.

Added Functionality: After Password Reset, next time the user enters with old password, a warning message saying that the password has been reset is shown to the user which is configurable and can be disabled also. While in case user enters any password other than the old one, that warning message will no more appear for that user.

Configurable options provided with this module:

1. Email Subject : Of the recovery mail to be sent.
2. Email Body: Of the recovery mail. HAS HTML MAIL SUPPORT (provided HTMLMAIL module is enabled) . ALSO SUPPORTS USER TOKENS.
3. Enable/Disable Warning Message shown to users for trying old password at login form.
4. Warning message to be shown as discussed above is itself configurable.
5. Redirect Path after Forgot Password Form/Page.

Similar Projects :

* Registration Password Token (https://www.drupal.org/project/rpt)
This module send password in the mail at the time of registration while Recovery Password Module sends new password in the mail when user clicks on forgot password.

* Simple Password Reset (https://www.drupal.org/project/simple_pass_reset)
It simplifies password reset process after user visits one time link. While Recovery password directly sends the new password in mail.

Main difference lies in the point that Recovery Password module SENDS NEW PASSWORD IN MAIL ITSELF.

Sandbox Project Link: https://www.drupal.org/sandbox/purushotam.rai/2563295

Git Clone Command

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/purushotam.rai/2563295.git recovery_password
cd recovery_password 

Manual reviews of other projects

* Cron Interval Actions : https://www.drupal.org/node/2563595#comment-10306333
* Extra SiteInfo: https://www.drupal.org/node/2560543#comment-10306861
* Google Plus Feeds: https://www.drupal.org/node/2498097#comment-10308205

Comments

purushotam.rai created an issue. See original summary.

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxpurushotamrai2563295git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

purushotam.rai’s picture

Status: Needs work » Needs review

Fixed PAReview's warnings.

purushotam.rai’s picture

Issue summary: View changes
purushotam.rai’s picture

Issue summary: View changes
purushotam.rai’s picture

Issue summary: View changes
rashid_786’s picture

Thanks for your contribution, here are my observations:

1. There is some contradiction to have the module name as "recovery_password" while the use case of the module to auto reset the password. I would suggest the name should be like "auto_reset_password".
2. As per recommendation, .module and .info should match with module directory name.
3. t() function should be used in

// Menu item for module configurations.
  $items['admin/config/people/recovery-pass'] = array(
    'title' => 'Recovery Password Configuration',

, which is required for translation purpose.
4. Configure setting link should be highlighted in module listing page for the ease of new users to reach at setting page.

rashid_786’s picture

Status: Needs review » Needs work
purushotam.rai’s picture

Status: Needs work » Needs review
StatusFileSize
new85.57 KB

Hey @rashid_786

Thanks for your valuable review. I appreciate your recommendation but this module does not work like u interpreted.

The module resets the password if and only when user submits the reset password form, so the module name cannot be changed.
Coming back to t() function ... In menu item , it is recommended not to use the t() function. https://www.drupal.org/node/323101

and for the last point i have already implemented this.... (screenshot attached.)

rashid_786’s picture

StatusFileSize
new19.03 KB

* I agree with, not to use t() in menu hook as per the referred doc.
* As per my interpretation, Module use case says, if any user wants to reset his/her password, will have to click on reset password link and redirect to reset password form, once he/she enters email address and then submit. they will get email with random password which can be used to login into the drupal site. It means, he/she doesn't need click the link to reset the password from the system (as per default functionality) instead will get auto reset password sent by your module through module. That's why i assume it should auto reset password because it doesn't recover old password.
* As per my local machine view i don't see configure link on module list ref. attachment.

purushotam.rai’s picture

StatusFileSize
new53.16 KB

Dear rashid_786,

Thanx for your comment, i would definitely give a thought to the module's name under the guidance of experts and for Configuration Link in Module Listing page u need to click on dropdown button right next to Help button. (Screenshot attached)

purushotam.rai’s picture

Issue tags: +PAreview: review bonus
Pradnya Pingat’s picture

Hi,

Automated Review

No Bug found in automation testing

Manual Review

Individual user account
[Yes: Follows]
No duplication
No duplication found
Master Branch
[Yes: Follows ]
3rd party assets/code
[Yes: Follows]
README.txt/README.md
[Yes: Follows ]
Code long/complex enough for review
[Yes: Follows]
Secure code
[Yes: Meets the security requirements]
Coding style & Drupal API usage
Coding standards are properly maintained

This review uses the Project Application Review Template.

Thanks.

rasikap’s picture

Works fine for me.

prateekjain’s picture

Status: Needs review » Reviewed & tested by the community
purushotam.rai’s picture

naveenvalecha’s picture

Assigned: Unassigned » klausi

Automated Review

Review of the 7.x-1.x branch (commit 2ea69ab):

  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements
Coding style & Drupal API usage
  1. Readme.txt is nice.
  2. recovery_pass_help : Remove the filter_xss_admin and check_plain from here .Readme is trusted source and provided by the module maintainer, so there is no need of sanitzation family functions here.
  3. recovery_pass_cron : Its just a recommendation to make the expiry period configurable.

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

Nothing major jumps at me .Assigning to klausi to give a final look if he has time.

purushotam.rai’s picture

Dear naveenvalecha,

Thanks for review. As per your recommendations, I have updated the module.

klausi’s picture

Assigned: klausi » Unassigned
Status: Reviewed & tested by the community » Fixed

Review of the 7.x-1.x branch (commit 233927f):

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
    FILE: /home/klausi/pareview_temp/recovery_pass.module
    ---------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ---------------------------------------------------------------------------
      55 | ERROR | Concatenating translatable strings is not allowed, use
         |       | placeholders instead and only one string literal
     228 | ERROR | Concatenating translatable strings is not allowed, use
         |       | placeholders instead and only one string literal
    ---------------------------------------------------------------------------
    
  • DrupalPractice has found some issues with your code, but could be false positives.
    FILE: /home/klausi/pareview_temp/recovery_pass.admin.inc
    ---------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------
     77 | WARNING | All variables defined by your module must be prefixed with
        |         | your module's name to avoid name collisions with others.
        |         | Expected start with "recovery_pass" but found
        |         | "recover_pass_expiry_period"
    ---------------------------------------------------------------------------
    
  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  • recovery_pass_forgot_password_submit(): hm, you are setting a new password for any user account here. So if I know your user name or email address I can overwrite your password all the time. This could be used as a denial of service attack: As anonymous user I just send a POST request every second to reset your password all the time, which means you can never login because your password will already be invalid again when you copy it from your email inbox. I would only allow overwriting the password every 10 minutes or similar, which is also no real solution. It feels wrong to me that any random anonymous user can overwrite the password of my user account as soon as they know my user name or email. Not sure if this should be a security blocker or not, but could you add a warning to the project page that describes this problem?

I have another idea: what if you do not overwrite the user password directly but rather leave it as is and store a second password in a separate table? You send out the second password per email and alter the login form to also accept that second password. That way users can still login with their old password, but also with the new password and the account is not changed. That should mitigate the security problem of attackers overwriting your password all the time. You could expire the second password after one day if it is not used.

Still, I don't understand the use case of this module, since password reset links are just so much better. Easier to use - just click a link, more secure: no passwords that can be stolen from emails.

Anyway, you seem to understand Drupal APIs otherwise, so ...

Thanks for your contribution, purushotam.rai!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.