Make WordPress Core


Ignore:
Timestamp:
06/08/2006 06:36:05 PM (18 years ago)
Author:
ryan
Message:

User management improvements from Mark Jaquith and David House. #2793

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/user-edit.php

    r3846 r3857  
    33
    44$title = __('Edit User');
    5 $parent_file = 'profile.php';
     5if ( current_user_can('edit_users') )
     6    $parent_file = 'users.php';
     7else
     8    $parent_file = 'profile.php';
    69$submenu_file = 'users.php';
    710
    8 $wpvarstoreset = array('action', 'redirect', 'profile', 'user_id');
     11$wpvarstoreset = array('action', 'redirect', 'profile', 'user_id', 'wp_http_referer');
    912for ($i=0; $i<count($wpvarstoreset); $i += 1) {
    1013    $wpvar = $wpvarstoreset[$i];
     
    2225}
    2326
     27$wp_http_referer = remove_query_arg(array('update', 'delete_count'), stripslashes($wp_http_referer));
     28
    2429switch ($action) {
    2530case 'switchposts':
     
    4146
    4247if( !is_wp_error( $errors ) ) {
    43     header("Location: user-edit.php?user_id=$user_id&updated=true");
     48    $redirect = "user-edit.php?user_id=$user_id&updated=true";
     49    $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect);
     50    header("Location: $redirect");
    4451    exit;
    4552}
     
    5865<div id="message" class="updated fade">
    5966    <p><strong><?php _e('User updated.') ?></strong></p>
     67    <?php if ( $wp_http_referer ) : ?>
     68    <p><a href="<?php echo wp_specialchars($wp_http_referer); ?>"><?php _e('&laquo; Back to Authors and Users'); ?></a></p>
     69    <?php endif; ?>
    6070</div>
    6171<?php endif; ?>
     
    7686<form name="profile" id="your-profile" action="user-edit.php" method="post">
    7787<?php wp_nonce_field('update-user_' . $user_id) ?>
     88<?php if ( $wp_http_referer ) : ?>
     89    <input type="hidden" name="wp_http_referer" value="<?php echo wp_specialchars($wp_http_referer); ?>" />
     90<?php endif; ?>
    7891<p>
    7992<input type="hidden" name="from" value="profile" />
Note: See TracChangeset for help on using the changeset viewer.