View Issue Details

IDProjectCategoryView StatusLast Update
0003118mantisbtbugtrackerpublic2004-02-29 07:20
Reporterjowouters Assigned Tovboctor  
PrioritynormalSeveritytrivialReproducibilityalways
Status closedResolutionfixed 
Product Version0.18.0 
Summary0003118: My Account: after update of password, wrong information is given.
Description

My Account: after update of password, it says "Email address successfully updated
Password successfully updated", while the email address didn't chance.

TagsNo tags attached.
Attached Files
3118_invalid_messages_when_modifying_account_info.diff (1,872 bytes)   
Index: account_update.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/account_update.php,v
retrieving revision 1.33
diff -u -r1.33 account_update.php
--- account_update.php	11 Jan 2004 07:16:05 -0000	1.33
+++ account_update.php	7 Feb 2004 12:49:57 -0000
@@ -33,7 +33,9 @@
 
 	$f_email = email_append_domain( $f_email );
 
-	user_set_email( auth_get_current_user_id(), $f_email );
+	# get the user id once, so that if we decide in the future to enable this for
+	# admins / managers to change details of other users.
+	$t_user_id = auth_get_current_user_id();
 
 	$t_redirect = 'account_page.php';
 
@@ -43,23 +45,27 @@
 
 	echo '<br /><div align="center">';
 
-	echo lang_get( 'operation_successful' );
-	echo '<br /><ul>';
-	echo '<li>' . lang_get( 'email_updated' ) . '</li>';
+	# @@@ Listing what fields were updated is not standard behaviour of Mantis
+	#     it also complicates the code.
+
+	echo lang_get( 'operation_successful' ) . '<br />';
+	if ( $f_email != user_get_email( $t_user_id ) ) {
+		user_set_email( $t_user_id, $f_email );
+		echo lang_get( 'email_updated' ) . '<br />';
+	}
 
 	# Update password if the two match and are not empty
 	if ( !is_blank( $f_password ) ) {
 		if ( $f_password != $f_password_confirm ) {
 			trigger_error( ERROR_USER_CREATE_PASSWORD_MISMATCH, ERROR );
 		} else {
-			user_set_password( auth_get_current_user_id(), $f_password );
-
-			echo '<li>' . lang_get( 'password_updated' ) . '</li>';
+			if ( !auth_does_password_match( $t_user_id, $f_password ) ) {
+				user_set_password( $t_user_id, $f_password );
+				echo lang_get( 'password_updated' ) . '<br />';
+			}
 		}
 	}
 
-	echo '</ul>';
-
 	print_bracket_link( $t_redirect, lang_get( 'proceed' ) );
 	echo '</div>';
 	html_page_bottom1( __FILE__ );

Activities

hacker

hacker

2003-04-09 15:41

reporter   ~0004147

Last edited: 2003-04-09 15:44

I just tried this, and found another weird bug lingering... the delay is set to 0, so account_page.php flashes to account_update.php for 1/2 second, barely visible, even when my prefs have Refresh Delay set to 10, and Redirect Delay set to 9. I logged out and back in after changing those preferences and had the same result. Changing $g_wait_time in the global config_inc.php file seemed to have the desired result, however. It would seem that the refresh/redirect delay set by the user is ignored on this particular page.

account_update.php just needs a check around line 48 to see if the previously-stored password is the same as the one entered, and if so, don't print the "email updated" string. If it differs (and is not blank), print the string.

edited on: 04-09-03 15:44

jowouters

jowouters

2004-01-17 04:26

reporter   ~0004896

This bug ("Email address successfully updated", while it didn't change at all) still exists in 0.18.0

vboctor

vboctor

2004-02-07 07:53

manager   ~0004978

hacker, can you please report the delay bug in a separate bug.

vboctor

vboctor

2004-02-07 07:56

manager   ~0004979

Patch attached and fixed in CVS. Will be included in the next release.

Related Changesets

MantisBT: master 175e9d78

2004-02-07 07:53

vboctor


Details Diff
Fix 0003118: My Account: after update of password, wrong information is given.

M account_update.php
- Generate the correct notifications based on the actual change to the account information.

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2327 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
0003118
mod - doc/ChangeLog Diff File
mod - account_update.php Diff File