* @copyright Yes, Open source, WebsiteFreelancers.nl * @version v 1.0 26-09-2009 Ramon$ */ global $wpdb,$current_user; $message = null; $showMsg = 'none'; /** * If submiting the form */ if (count($_POST)) { $oldName = htmlspecialchars(trim($_POST['plugin_admin_renamer-oldname'.intval($_GET['user_id'])])); $newName = htmlspecialchars(trim($_POST['plugin_admin_renamer-newname'.intval($_GET['user_id'])])); if(empty($newName)) { $message = $oldName. ' NOT changed, new name was empty!'; $showMsg = 'block'; } else { $user_query = "UPDATE $wpdb->users SET user_login = '{$newName}' WHERE {$wpdb->users}.ID = ".intval($_GET['user_id'])." LIMIT 1"; $wpdb->get_results( $user_query ); $message = 'Changed '.$oldName. ' into '.$newName; $showMsg = 'block'; } } ?>
Current admin username: user_login; ?>
ID == 1)
{
echo '
Warning: This is the MAIN admin or site owner!';
}
if($row->ID == $current_user->ID)
{
echo '
Warning: This is you! After changing your login name you might need to log in again!';
}
?>