From 101ac654d15a51f3fa50a2bb555741d88ca1476e Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 6 Sep 2005 06:58:02 +0000 Subject: [PATCH] Better names and typo. git-svn-id: http://svn.automattic.com/wordpress/trunk@2844 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/profile-update.php | 138 ++++++++++++++++-------------------- wp-admin/profile.php | 16 ++--- wp-admin/wp-admin.css | 2 +- 3 files changed, 72 insertions(+), 84 deletions(-) diff --git a/wp-admin/profile-update.php b/wp-admin/profile-update.php index b101f9717f..e9eeac38c1 100644 --- a/wp-admin/profile-update.php +++ b/wp-admin/profile-update.php @@ -1,76 +1,64 @@ -ERROR: your ICQ UIN can only be a number, no letters allowed")); - return false; - } -} - -/* checking e-mail address */ -if (empty($_POST["newuser_email"])) { - die (__("ERROR: please type your e-mail address")); - return false; -} else if (!is_email($_POST["newuser_email"])) { - die (__("ERROR: the e-mail address isn't correct")); - return false; -} - -$pass1 = $_POST['pass1']; -$pass2 = $_POST['pass2']; -do_action('check_passwords', array($user_login, &$pass1, &$pass2)); - -if ( '' == $pass1 ) { - if ( '' != $pass2 ) - die (__('ERROR: you typed your new password only once. Go back to type it twice.')); - $updatepassword = ''; -} else { - if ('' == $pass2) - die (__('ERROR: you typed your new password only once. Go back to type it twice.')); - if ( $pass1 != $pass2 ) - die (__('ERROR: you typed two different passwords. Go back to correct that.')); - $newuser_pass = $pass1; - $updatepassword = "user_pass=MD5('$newuser_pass'), "; - wp_clearcookie(); - wp_setcookie($user_login, $newuser_pass); -} - -$newuser_firstname = wp_specialchars($_POST['newuser_firstname']); -$newuser_lastname = wp_specialchars($_POST['newuser_lastname']); -$new_display_name = wp_specialchars($_POST['display_name']); -$newuser_nickname = $_POST['newuser_nickname']; -$newuser_nicename = sanitize_title($newuser_nickname); -$jabber = wp_specialchars($_POST['jabber']); -$newuser_aim = wp_specialchars($_POST['newuser_aim']); -$newuser_yim = wp_specialchars($_POST['newuser_yim']); -$newuser_email = wp_specialchars($_POST['newuser_email']); -$newuser_url = wp_specialchars($_POST['newuser_url']); -$newuser_url = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $newuser_url) ? $newuser_url : 'http://' . $newuser_url; -$user_description = $_POST['user_description']; - -$result = $wpdb->query("UPDATE $wpdb->users SET $updatepassword user_email='$newuser_email', user_url='$newuser_url', user_nicename = '$newuser_nicename', display_name = '$new_display_name' WHERE ID = $user_ID"); - -update_usermeta( $user_ID, 'first_name', $newuser_firstname ); -update_usermeta( $user_ID, 'last_name', $newuser_lastname ); -update_usermeta( $user_ID, 'nickname', $newuser_nickname ); -update_usermeta( $user_ID, 'description', $user_description ); -update_usermeta( $user_ID, 'jabber', $jabber ); -update_usermeta( $user_ID, 'aim', $newuser_aim ); -update_usermeta( $user_ID, 'yim', $newuser_yim ); - -do_action('profile_update', $user_ID); - -if ( 'profile' == $_POST['from'] ) - $to = 'profile.php?updated=true'; -else - $to = 'profile.php?updated=true'; - -wp_redirect( $to ); -exit; - +ERROR: please type your e-mail address")); +elseif ( !is_email($_POST['email']) ) + die (__("ERROR: the e-mail address isn't correct")); + +$pass1 = $_POST['pass1']; +$pass2 = $_POST['pass2']; +do_action('check_passwords', array($user_login, &$pass1, &$pass2)); + +if ( '' == $pass1 ) { + if ( '' != $pass2 ) + die (__('ERROR: you typed your new password only once. Go back to type it twice.')); + $updatepassword = ''; +} else { + if ('' == $pass2) + die (__('ERROR: you typed your new password only once. Go back to type it twice.')); + if ( $pass1 != $pass2 ) + die (__('ERROR: you typed two different passwords. Go back to correct that.')); + $newuser_pass = $pass1; + $updatepassword = "user_pass=MD5('$newuser_pass'), "; + wp_clearcookie(); + wp_setcookie($user_login, $newuser_pass); +} + +$first_name = wp_specialchars($_POST['first_name']); +$last_name = wp_specialchars($_POST['last_name']); +$display_name = wp_specialchars($_POST['display_name']); +$nickname = $_POST['nickname']; +$nicename = sanitize_title($nickname); +$jabber = wp_specialchars($_POST['jabber']); +$aim = wp_specialchars($_POST['aim']); +$yim = wp_specialchars($_POST['yim']); +$email = wp_specialchars($_POST['email']); +$url = wp_specialchars($_POST['url']); +$url = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $newuser_url) ? $newuser_url : 'http://' . $newuser_url; +$user_description = $_POST['user_description']; + +$result = $wpdb->query("UPDATE $wpdb->users SET $updatepassword user_email='$email', user_url='$url', user_nicename = '$nicename', display_name = '$display_name' WHERE ID = '$user_ID'"); + +update_usermeta( $user_ID, 'first_name', $first_name ); +update_usermeta( $user_ID, 'last_name', $last_name ); +update_usermeta( $user_ID, 'nickname', $nickname ); +update_usermeta( $user_ID, 'description', $user_description ); +update_usermeta( $user_ID, 'jabber', $jabber ); +update_usermeta( $user_ID, 'aim', $aim ); +update_usermeta( $user_ID, 'yim', $yim ); + +do_action('profile_update', $user_ID); + +if ( 'profile' == $_POST['from'] ) + $to = 'profile.php?updated=true'; +else + $to = 'profile.php?updated=true'; + +wp_redirect( $to ); +exit; + ?> \ No newline at end of file diff --git a/wp-admin/profile.php b/wp-admin/profile.php index e63329382f..27bec9f849 100644 --- a/wp-admin/profile.php +++ b/wp-admin/profile.php @@ -31,13 +31,13 @@ $bookmarklet_height= 440;

+

+

+

+

+


diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index 345955ffa9..f8920b98b1 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -681,7 +681,7 @@ table .vers, table .name { margin: 1em; } -#your-profile fieldset input, { +#your-profile fieldset input { width: 100%; font-size: 20px; padding: 2px;