From 2deb7ed927ba4f38c7920e1d0fb82a85edc031fd Mon Sep 17 00:00:00 2001 From: donncha Date: Mon, 7 Nov 2005 09:22:04 +0000 Subject: Massive WP Merge git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@417 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-inst/wp-admin/admin-functions.php | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'wp-inst/wp-admin/admin-functions.php') diff --git a/wp-inst/wp-admin/admin-functions.php b/wp-inst/wp-admin/admin-functions.php index b88ef8f..cc7af04 100644 --- a/wp-inst/wp-admin/admin-functions.php +++ b/wp-inst/wp-admin/admin-functions.php @@ -256,6 +256,7 @@ function add_user() { } function edit_user($user_id = 0) { + global $current_user, $wp_roles; if ($user_id != 0) { $update = true; @@ -276,6 +277,14 @@ function edit_user($user_id = 0) { if (isset ($_POST['pass2'])) $pass2 = $_POST['pass2']; + if (isset ($_POST['role'])) { + if($user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap('edit_users')) + $user->role = $_POST['role']; + } + + if (isset ($_POST['role'])) { + $user->role = $_POST['role']; + } if (isset ($_POST['email'])) $user->user_email = wp_specialchars(trim($_POST['email'])); if (isset ($_POST['url'])) { @@ -430,7 +439,11 @@ function checked($checked, $current) { function return_categories_list($parent = 0) { global $wpdb; - return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY category_count DESC"); + return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent"); +} + +function sort_cats($cat1, $cat2) { + return strcasecmp($cat1['cat_name'], $cat2['cat_name']); } function get_nested_categories($default = 0, $parent = 0) { @@ -463,6 +476,8 @@ function get_nested_categories($default = 0, $parent = 0) { $result[$cat]['cat_name'] = get_the_category_by_ID($cat); } } + + usort($result, 'sort_cats'); return $result; } @@ -856,11 +871,11 @@ function touch_time($edit = 1, $for_post = 1) { } ?> - - @ - : - - + + @ + : + + :