From 85c26fdeba0bd6151df04a698640612fa5973565 Mon Sep 17 00:00:00 2001 From: int2str Date: Wed, 26 May 2004 02:28:55 +0000 Subject: [PATCH] Applied Cristian Hack's patch to allow users to edit their real name (Bug 3876). git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2572 f5dc347c-c33d-0410-90a0-b07cc1902cb9 --- account_page.php | 12 +++++++++++- account_update.php | 8 +++++++- core/user_api.php | 20 ++++++++++++++++++-- lang/strings_english.txt | 7 ++++--- manage_user_edit_page.php | 12 +++++++++++- 5 files changed, 51 insertions(+), 8 deletions(-) diff --git a/account_page.php b/account_page.php index 17a9446b0c..6db52566d4 100644 --- a/account_page.php +++ b/account_page.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: account_page.php,v 1.44 2004-05-06 13:09:35 vboctor Exp $ + # $Id: account_page.php,v 1.45 2004-05-26 02:28:54 int2str Exp $ # -------------------------------------------------------- # CALLERS @@ -157,6 +157,16 @@ + + + + + + + + + + diff --git a/account_update.php b/account_update.php index 76e4a91af4..843d9ea318 100644 --- a/account_update.php +++ b/account_update.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: account_update.php,v 1.34 2004-02-07 12:53:41 vboctor Exp $ + # $Id: account_update.php,v 1.35 2004-05-26 02:28:55 int2str Exp $ # -------------------------------------------------------- ?> '; } + if ( $f_realname != user_get_name( $t_user_id ) ) { + user_set_realname( $t_user_id, $f_realname ); + echo lang_get( 'realname_updated' ) . '
'; + } + # Update password if the two match and are not empty if ( !is_blank( $f_password ) ) { if ( $f_password != $f_password_confirm ) { diff --git a/core/user_api.php b/core/user_api.php index 31569cfd56..7cfd537b60 100644 --- a/core/user_api.php +++ b/core/user_api.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: user_api.php,v 1.72 2004-05-25 13:38:50 vboctor Exp $ + # $Id: user_api.php,v 1.73 2004-05-26 02:28:55 int2str Exp $ # -------------------------------------------------------- $t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR; @@ -464,6 +464,14 @@ function user_get_email( $p_user_id ) { return $t_email; } + # -------------------- + # lookup the user's realname + function user_get_realname( $p_user_id ) { + $t_realname = user_get_field( $p_user_id, 'realname' ); + + return $t_realname; + } + # -------------------- # return the username or a string "user" if the user does not exist function user_get_name( $p_user_id ) { @@ -718,6 +726,14 @@ function user_set_email( $p_user_id, $p_email ) { return user_set_field( $p_user_id, 'email', $p_email ); } + # -------------------- + # Set the user's realname to the given string after checking validity + function user_set_realname( $p_user_id, $p_realname ) { + # @@@ TODO: ensure_realname_valid( $p_realname ); + + return user_set_field( $p_user_id, 'realname', $p_realname ); + } + # -------------------- # Set the user's username to the given string after checking that it is valid function user_set_name( $p_user_id, $p_username ) { @@ -769,4 +785,4 @@ function user_reset_password( $p_user_id, $p_send_email=true ) { return true; } -?> \ No newline at end of file +?> diff --git a/lang/strings_english.txt b/lang/strings_english.txt index 8ea2592780..adbd948120 100644 --- a/lang/strings_english.txt +++ b/lang/strings_english.txt @@ -9,11 +9,11 @@ ########################################################################### # English strings for Mantis # ------------------------------------------------- - # $Revision: 1.174 $ + # $Revision: 1.175 $ # $Author: int2str $ - # $Date: 2004-05-25 23:43:48 $ + # $Date: 2004-05-26 02:28:55 $ # - # $Id: strings_english.txt,v 1.174 2004-05-25 23:43:48 int2str Exp $ + # $Id: strings_english.txt,v 1.175 2004-05-26 02:28:55 int2str Exp $ ########################################################################### ?> @@ -58,6 +58,16 @@ + +> + + : + + + + + + >