Password reset link
anarcat - September 3, 2009 - 09:13
| Project: | Hostmaster |
| Version: | 6.x-0.4-alpha1 |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
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...

#1
Great idea!
Will be helpful in our helpdesk integration: nr 2 on my list: http://omega8.cc/lab
~Grace
#2
I'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 :)
#3
So 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.
#4
Forgot about this.
Testing welcome.
#5
Shouldn't this be put straight into drush, at least for the backend stuff?
#6
Sorry.
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
cd /var/aegir/drupal-6.14; drush login_reset --uri=http://example.comcd /var/aegir/drupal-6.14/sites/example.com; drush login_reset
cd <anywhere>; drush --root=/var/aegir/drupal-6.14 --uri=http://example.com login_reset
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..
#7
Latest commit now takes uid as an argument, so it can provide a onetime reset link for other users
#8
reworked it a bit to play nice with the login link code.
committed to head.
#9
Automatically closed -- issue fixed for 2 weeks with no activity.