summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-admin/admin-functions.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-11-07 09:22:04 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-11-07 09:22:04 +0000
commit2deb7ed927ba4f38c7920e1d0fb82a85edc031fd (patch)
tree6e3f9b353a79a10e67602b88be98a274bcc8dfe0 /wp-inst/wp-admin/admin-functions.php
parent99532e55fc2d3de5c265bc36976664d1eedbe2ea (diff)
downloadwordpress-mu-2deb7ed927ba4f38c7920e1d0fb82a85edc031fd.tar.gz
wordpress-mu-2deb7ed927ba4f38c7920e1d0fb82a85edc031fd.tar.xz
wordpress-mu-2deb7ed927ba4f38c7920e1d0fb82a85edc031fd.zip
Massive WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@417 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-admin/admin-functions.php')
-rw-r--r--wp-inst/wp-admin/admin-functions.php27
1 files changed, 21 insertions, 6 deletions
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) {
}
?>
</select>
-<input type="text" name="jj" value="<?php echo $jj; ?>" size="2" maxlength="2" />
-<input type="text" name="aa" value="<?php echo $aa ?>" size="4" maxlength="5" /> @
-<input type="text" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" /> :
-<input type="text" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" />
-<input type="hidden" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" />
+<input type="text" id="jj" name="jj" value="<?php echo $jj; ?>" size="2" maxlength="2" />
+<input type="text" id="aa" name="aa" value="<?php echo $aa ?>" size="4" maxlength="5" /> @
+<input type="text" id="hh" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" /> :
+<input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" />
+<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" />
<?php _e('Existing timestamp'); ?>:
<?php