From d271668438223581c813657c5fbbb33ee2adeae8 Mon Sep 17 00:00:00 2001
From: azaozz
Date: Sat, 16 May 2009 06:29:10 +0000
Subject: [PATCH] Clean up user-edit.php, add password strength meter to Add
User and Edit User
git-svn-id: http://svn.automattic.com/wordpress/trunk@11359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
wp-admin/user-edit.php | 41 ++++++++++++++++++-----------------------
wp-admin/user-new.php | 7 ++++++-
wp-admin/wp-admin.css | 9 +++------
3 files changed, 27 insertions(+), 30 deletions(-)
diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php
index 8e592ecd8..714cea170 100644
--- a/wp-admin/user-edit.php
+++ b/wp-admin/user-edit.php
@@ -9,18 +9,14 @@
/** WordPress Administration Bootstrap */
require_once('admin.php');
-if ( defined('IS_PROFILE_PAGE') && IS_PROFILE_PAGE )
- $is_profile_page = true;
-else
- $is_profile_page = false;
+if ( !defined('IS_PROFILE_PAGE') )
+ define('IS_PROFILE_PAGE', false);
-if ( $is_profile_page ) {
- wp_enqueue_script('user-profile');
- wp_enqueue_script('password-strength-meter');
-}
+wp_enqueue_script('user-profile');
+wp_enqueue_script('password-strength-meter');
-$title = $is_profile_page? __('Profile') : __('Edit User');
-if ( current_user_can('edit_users') && !$is_profile_page )
+$title = IS_PROFILE_PAGE ? __('Profile') : __('Edit User');
+if ( current_user_can('edit_users') && !IS_PROFILE_PAGE )
$submenu_file = 'users.php';
else
$submenu_file = 'profile.php';
@@ -33,7 +29,7 @@ $wp_http_referer = remove_query_arg(array('update', 'delete_count'), stripslashe
$user_id = (int) $user_id;
if ( !$user_id ) {
- if ( $is_profile_page ) {
+ if ( IS_PROFILE_PAGE ) {
$current_user = wp_get_current_user();
$user_id = $current_user->ID;
} else {
@@ -75,7 +71,7 @@ check_admin_referer('update-user_' . $user_id);
if ( !current_user_can('edit_user', $user_id) )
wp_die(__('You do not have permission to edit this user.'));
-if ($is_profile_page)
+if ( IS_PROFILE_PAGE )
do_action('personal_options_update', $user_id);
else
do_action('edit_user_profile_update', $user_id);
@@ -83,7 +79,7 @@ else
$errors = edit_user($user_id);
if ( !is_wp_error( $errors ) ) {
- $redirect = ($is_profile_page? "profile.php?" : "user-edit.php?user_id=$user_id&"). "updated=true";
+ $redirect = (IS_PROFILE_PAGE ? "profile.php?" : "user-edit.php?user_id=$user_id&"). "updated=true";
$redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect);
wp_redirect($redirect);
exit;
@@ -101,7 +97,7 @@ include ('admin-header.php');
@@ -173,7 +169,7 @@ do_action('personal_options', $profileuser);
?>
@@ -185,7 +181,7 @@ do_action('personal_options', $profileuser);
|
-
+
|
|
-
+
|
@@ -280,7 +276,7 @@ else
-
+
-
+
diff --git a/wp-admin/user-new.php b/wp-admin/user-new.php
index ae3295d15..59a7460b6 100644
--- a/wp-admin/user-new.php
+++ b/wp-admin/user-new.php
@@ -37,6 +37,8 @@ $title = __('Add New User');
$parent_file = 'users.php';
wp_enqueue_script('wp-ajax-response');
+wp_enqueue_script('user-profile');
+wp_enqueue_script('password-strength-meter');
require_once ('admin-header.php');
@@ -117,7 +119,10 @@ $new_user_send_password = !$_POST || isset($_POST['send_password']);
|
- |
+
+
+
+
|
diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css
index 8c182393c..ccc78f45c 100644
--- a/wp-admin/wp-admin.css
+++ b/wp-admin/wp-admin.css
@@ -1304,8 +1304,9 @@ textarea.large-text {
width: 99%;
}
-.form-table input.regular-text {
- width: 325px;
+.form-table input.regular-text,
+#adduser .form-field input {
+ width: 25em;
}
.form-table input.small-text {
@@ -1317,10 +1318,6 @@ textarea.large-text {
margin-bottom: 6px;
}
-#profile-page .form-table input[type=text] {
- width: 300px;
-}
-
#profile-page .form-table #rich_editing {
margin-right: 5px
}