News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Redirect from password reset

Started by blockus, January 22, 2012, 05:41:25 PM

Previous topic - Next topic

blockus

I'm using smf 2.0.1 with a variation of curve.  I'm looking to make a little tweak to where people are redirected after they submit a new password (after they've clicked the link in the forgot password email, put in their new password twice, and hit save).  I'm pretty sure that all I have to do is stick a redirectexit(address) in at the right point in the code.  Which file controls the password reset, and where exactly in the file do I have to stick the redirect command?

Thanks, as always, for your help!

-CB 

Matthew K.

Hey there!

You'll want to look at Subs-Members.php most likely, in ./Sources.

I can't look into it myself right now, but I'd assume that's where the reset Source function is.

blockus

I looked in there and didn't see anything about re-setting a password.  I'm not a great coder, though; I just kind of use the notes as a guide.  Anybody know where in particular in that document (or in another one if that's not right) I should look for this?

Thanks!

-CB

Matthew K.

Have you looked in the SMF Function Database yet?

Matthew K.


blockus

Hey, thanks for the reply!

#1 I looked all through that file and couldn't find anything about changing a password.  Where in that file should I look?

#2 I haven't looked at the functions database.  By that you mean a table in the forum database?  What should I be looking for in there?

Thanks!

-CB


blockus

hahahaha thank you very much. n00b to the core.

Matthew K.


blockus

Well that was a handy little list.  I think what I need is actually on Sources.Reminder.php.  I'm looking for a place in the code to put this redirect and I just can't seem to make it work.  Everything about the password reset process works great (from the email to the reset), but I have an issue when the forum generates the logon form.  I'd like to redirect them to another page after they reset their password.  I THINK this is the area of the code that handles all of this:

// User validated.  Update the database!
updateMemberData($_POST['u'], array('validation_code' => '', 'passwd' => sha1(strtolower($username) . $_POST['passwrd1'])));

call_integration_hook('integrate_reset_pass', array($username, $username, $_POST['passwrd1']));


loadTemplate('Login');
$context += array(
'page_title' => $txt['reminder_password_set'],
'sub_template' => 'login',
'default_username' => $username,
'default_password' => $_POST['passwrd1'],
'never_expire' => false,
'description' => $txt['reminder_password_set']
);

}


I've been messing around with it to no success.  First, am I in the right place after all?  Secondly, is there a place to drop a redirectexit(address) so that their password is reset and then they are sent off?

Thanks as always!

-CB

Arantor

Just before the $context at the end of that function ;)

blockus

Ok when I put the redirectexit there, the authentication reminder form doesn't appear.  I need that authentication reminder form to show up, and after the email arrives, the authentication reminder to enter the new password twice needs to show up too.  I want to redirect after you hit "save" on that form.

Ideas?  Thanks!

-CB

blockus

Ok, I found where this form actually builds (Reminder.Template.php).  I found where the save button is configured <p class="align_center"><input type="submit" value="', $txt['save'], '" class="button_submit" /></p> Is there a way to specify a url to direct to when that button is clicked without messing with its submit function?

Thanks as always,

-CB

blockus

Is there any further information I can provide to make this question answerable?  I'd really like to get this job done.

Thanks!

-CB

Advertisement: