View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0011394 | mantisbt | authentication | public | 2010-01-14 16:43 | 2010-04-23 14:30 |
Reporter | atrol | Assigned To | dhx | ||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | git trunk | ||||
Target Version | 1.2.1 | Fixed in Version | 1.2.0 | ||
Summary | 0011394: Lost password not working, no message output, no mail | ||||
Description | when clicking "lost password" and entering a valid username and e-mail MantisBT returns to login page. No e-mail is sent. No message is displayed like in 1.1.x | ||||
Additional Information | nightly build from 14.01.2010 | ||||
Tags | No tags attached. | ||||
I just ran into the same problem on our 1.2.0rc2 installed version today |
|
I think this one should have set "Target Version" to 1.2.x because standard functionality which was working in 1.1.x is broken. |
|
Isn't it the core/email_api.php problem in the line (#472 if I'm not wrong): which doesn't work (maybe with certain languages, I'm not sure). If so, try to comment this line (this works for me). |
|
"Target Version" to 1.2.0 IMHO indeed. |
|
Can confirm that commenting line #472 of core/email_api.php with lang_push( user_pref_get_language( $p_user_id ) ); solves the problem for now. |
|
Thanks for the bug report, and finding which line caused the issue. I should have fixed it now (in both 1.2.x and 1.3.x branches). I suspect this problem arises when a user language preference is incorrect or invalid in some way. Now it should fall back to the default language of the MantisBT installation when the user language preference is not correct. |
|
Please test this for me (as I couldn't reproduce the original issue) and reopen if the problem still remains. Thanks! |
|
still not working |
|
Try adding these two lines to the bottom of config_inc.php to see if it makes a difference: $g_send_reset_password = ON; Also, password reset emails aren't sent for protected accounts. |
|
This is a fresh test installation without any special configuration in config_inc.php Content of config_inc.php:
Am I right, that the values in config_defaults_inc.php are taken if there is no other configuration? I think this was a typo, I didn't find in source: My test users are not protected Further hint: If you want you can try my test installation to verify the behaviour (This is the latest nightly build from today, which contains your latest commits in GIT) |
|
I think the patch from 0010780 may fix this issue? We forgot to backport it to the 1.2.x branch which may explain why I couldn't reproduce this problem (I use the 1.3.x branch typically). Please checkout the latest 1.2.x master branch from git.mantisbt.org and see if things are working again. I can confirm that with my setup, the lost password functionality is working fine on the latest version of 1.2.x. |
|
I noticed this patch yesterday and tried already. But behaviour didn't change. |
|
Also not working with 1.3dev (where I had to tweak the new encryption code to get it run, but this is another story ...) |
|
Have a look at 0011493 |
|
Same here. Just downloaded 1.2.x master from 13-2-2010 and the error is still there. When disabling lang_push( user_pref_get_language( $p_user_id ) ); oin line 494 of core/email_api.php then all works fine. Also, the user I've tried that with has a proper language configured, so the note from the latest changeset doesn't apply here. The problem must be something else. |
|
Can someone please try reproducing this problem with the following error verbosity settings in config_inc.php: $g_show_detailed_errors = ON; This should hopefully provide more information on any errors that may be occurring. Thanks |
|
I've tried it and what's strange: when using those settings and uncommenting lang_push( user_pref_get_language( $p_user_id ) ); in email_api.php, again no email is sent out :-( and no error message produced. Cross tests performed: When creating an error elsewhere, I get a very detailed error message, so that part works. Commenting the line in email_api.php again, emails get sent out. So, something in either user_pref_get_language() or in lang_push() must happen that avoids sending email but doesn't throw an error. |
|
I still had this problem after using the changeset below, but I have now fixed it with a small change. In user_pref_api.php, in the user_pref_get() function, there is a line (around line 480): if ( auth_get_current_user_id() == $p_user_id ) { I have changed this to: if ( auth_is_user_authenticated() && auth_get_current_user_id() == $p_user_id ) { The problem seems to be that if there is no logged in user (and there won't be for a password reset from the login screen), the auth_get_current_user_id() function will throw you back to the login screen immediately. Checking whether the user is actually logged in gets round this. |
|
Thanks DominionSpy, your changes are correct and I've applied them to the repository. Apologies with the delay in getting this fixed. |
|
If anyone still experiences problems with the latest git checkout of the 1.2.x or 1.3.x branches, please reopen this issue again. Thanks |
|
MantisBT: master-1.2.x 5f7cef9d 2010-02-07 20:08 Details Diff |
Fix 0011394: Lost password email not sent when user language is invalid When the language specified in the preferences for a user does not exist or is otherwise invalid (for example: when updating from previous versions of MantisBT), the lost password email is not sent to the user. This is probably because of lang_push( user_pref_get_language( user_id ) ) where user_pref_get_language can return false and lang_push expects a string (or null). |
Affected Issues 0011394 |
|
mod - core/lang_api.php | Diff File | ||
mod - core/user_pref_api.php | Diff File | ||
MantisBT: master c8e30df5 2010-02-07 20:08 Details Diff |
Fix 0011394: Lost password email not sent when user language is invalid When the language specified in the preferences for a user does not exist or is otherwise invalid (for example: when updating from previous versions of MantisBT), the lost password email is not sent to the user. This is probably because of lang_push( user_pref_get_language( user_id ) ) where user_pref_get_language can return false and lang_push expects a string (or null). |
Affected Issues 0011394 |
|
mod - core/lang_api.php | Diff File | ||
mod - core/user_pref_api.php | Diff File | ||
MantisBT: master-1.2.x 1a1c9762 2010-04-21 08:43 Details Diff |
Fix 0011394: No email sent for lost password process When a MantisBT installation is setup without anonymous access enabled auth_get_current_user_id() will fail, redirecting the user back to the login screen. This was due to a problem in user_pref_get() where it was assumed that a user was logged in. For the lost password recovery step (with no anonymous login), the lost password recovery step happens without any user logged in. |
Affected Issues 0011394 |
|
mod - core/user_pref_api.php | Diff File | ||
MantisBT: master 2e73850a 2010-04-21 08:43 Details Diff |
Fix 0011394: No email sent for lost password process When a MantisBT installation is setup without anonymous access enabled auth_get_current_user_id() will fail, redirecting the user back to the login screen. This was due to a problem in user_pref_get() where it was assumed that a user was logged in. For the lost password recovery step (with no anonymous login), the lost password recovery step happens without any user logged in. |
Affected Issues 0011394 |
|
mod - core/user_pref_api.php | Diff File |