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

omega8cc - September 5, 2009 - 00:29

Great idea!

Will be helpful in our helpdesk integration: nr 2 on my list: http://omega8.cc/lab

~Grace

#2

mig5 - September 5, 2009 - 09:53

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

anarcat - September 7, 2009 - 13:25

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

mig5 - September 26, 2009 - 13:14
Version:6.x-0.3» 6.x-0.4-alpha1
Status:active» needs review

Forgot about this.

Testing welcome.

AttachmentSize
567094_hosting_login_reset.patch 546 bytes
567094_provision_login_reset.patch 1.67 KB

#5

anarcat - September 28, 2009 - 14:38

Shouldn't this be put straight into drush, at least for the backend stuff?

#6

mig5 - September 29, 2009 - 07:59
Status:needs review» needs work

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.com
cd /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

mig5 - September 29, 2009 - 10:02

Latest commit now takes uid as an argument, so it can provide a onetime reset link for other users

#8

adrian - October 23, 2009 - 00:01
Status:needs work» fixed

reworked it a bit to play nice with the login link code.

committed to head.

#9

System Message - November 6, 2009 - 00:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.