Skip to content

Commit

Permalink
Fix #3118: My Account: after update of password, wrong information is…
Browse files Browse the repository at this point in the history
… 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 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
vboctor committed Feb 7, 2004
1 parent aa947b0 commit 175e9d7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
26 changes: 16 additions & 10 deletions account_update.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: account_update.php,v 1.33 2004-01-11 07:16:05 vboctor Exp $
# $Id: account_update.php,v 1.34 2004-02-07 12:53:41 vboctor Exp $
# --------------------------------------------------------
?>
<?php
Expand All @@ -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';

Expand All @@ -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__ );
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -2,6 +2,7 @@ Mantis ChangeLog

2004.xx.xx - 0.18.2

* Fix #3118: My Account: after update of password, wrong information is given.
* Fix #3537: Rewriting custom values with 0 when updating a bug.
* Fix #3539: Simple view page shows advanced custom fields.

Expand Down

0 comments on commit 175e9d7

Please sign in to comment.