Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Site nodes should have a "password reset" button that would create a password reset link and/or send a password reset email... Not sure we need a drush task for that, but if that will do it...
Comment | File | Size | Author |
---|---|---|---|
#4 | 567094_hosting_login_reset.patch | 546 bytes | mig5 |
#4 | 567094_provision_login_reset.patch | 1.67 KB | mig5 |
Comments
Comment #1
omega8cc CreditAttribution: omega8cc commentedGreat idea!
Will be helpful in our helpdesk integration: nr 2 on my list: http://omega8.cc/lab
~Grace
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedI've done some preliminary work on this, created a 'Login reset' task and corresponding provision command etc.. it felt easier that way (through drush etc) because we need to be executing user_pass_reset_url() using account and site parameters from the specific site.. if you can think of an easier way, I'm all ears :)
I'll update when I have something workable. Basically it's all there except, um, the actual code in the provision command's .inc that does all the work :)
Comment #3
anarcat CreditAttribution: anarcat commentedSo what I think is that this should be part of drush itself. It would help the whole drupal community. It's simply a matter of adding a drush password reset command that shows a password reset URL on stdout and catch that in the frontend.
It's rather silly that we have to wait for the cronjob to get that, but I can't think of any other way right now.
If you want some inspiration on how to create a drush command, look at how clone was implemented and how the install_6.inc stuff works for the password reset.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedForgot about this.
Testing welcome.
Comment #5
anarcat CreditAttribution: anarcat commentedShouldn't this be put straight into drush, at least for the backend stuff?
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedSorry.
Anyway I've a very simple drush command that's working, here's my git repo.
I haven't hooked this into the frontend yet because I admit I really don't understand Drush all that well and I don't know how to pass a URL to it the way we do with provision. Trying to learn now.
Meantime you can drop login_reset into .drush and run any of the following and it works
Currently it only does a login reset for uid 1, maybe when I understand how to pass proper arguments I will add the option to pass a uid or username as well..
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedLatest commit now takes uid as an argument, so it can provide a onetime reset link for other users
Comment #8
adrian CreditAttribution: adrian commentedreworked it a bit to play nice with the login link code.
committed to head.