user_level >= $user_level) die( __('You do not have permission to edit this user.') ); /* checking the nickname has been typed */ if (empty($_POST["new_nickname"])) { die (__("ERROR: please enter your nickname (can be the same as your username)")); return false; } $new_user_login = wp_specialchars($_POST['new_user_login']); $pass1 = $_POST['pass1']; $pass2 = $_POST['pass2']; do_action('check_passwords', array($new_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.")); $new_pass = $pass1; $updatepassword = "user_pass=MD5('$new_pass'), "; } $new_firstname = wp_specialchars($_POST['new_firstname']); $new_lastname = wp_specialchars($_POST['new_lastname']); $new_nickname = $_POST['new_nickname']; $new_nicename = sanitize_title($new_nickname, $user_id); $new_icq = wp_specialchars($_POST['new_icq']); $new_aim = wp_specialchars($_POST['new_aim']); $new_msn = wp_specialchars($_POST['new_msn']); $new_yim = wp_specialchars($_POST['new_yim']); $new_email = wp_specialchars($_POST['new_email']); $new_url = wp_specialchars($_POST['new_url']); $new_url = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $new_url) ? $new_url : 'http://' . $new_url; $new_idmode = wp_specialchars($_POST['new_idmode']); $new_description = $_POST['new_description']; $result = $wpdb->query("UPDATE $wpdb->users SET user_login = '$new_user_login', $updatepassword user_email='$new_email', user_url='$new_url', user_nicename = '$new_nicename' WHERE ID = '$user_id'"); update_user_meta( $user_ID, 'first_name', $new_firstname ); update_user_meta( $user_ID, 'last_name', $new_lastname ); update_user_meta( $user_ID, 'nickname', $new_nickname ); update_user_meta( $user_ID, 'description', $new_description ); update_user_meta( $user_ID, 'icq', $new_icq ); update_user_meta( $user_ID, 'aim', $new_aim ); update_user_meta( $user_ID, 'msn', $new_msn ); update_user_meta( $user_ID, 'yim', $new_yim ); header("Location: user-edit.php?user_id=$user_id&updated=true"); break; case 'switchposts': check_admin_referer(); /* TODO: Switch all posts from one user to another user */ break; default: include ('admin-header.php'); $edituser = get_userdata($user_id); if ($edituser->user_level >= $user_level) die( __('You do not have permission to edit this user.') ); ?>