Skip to:
Content

BuddyPress.org

Ticket #965: site-admin-edit-user-settings.patch

File site-admin-edit-user-settings.patch, 4.8 KB (added by johnjamesjacoby, 15 years ago)
  • bp-core-settings.php

     
    7171}
    7272
    7373function bp_core_screen_general_settings_content() {
    74         global $bp, $current_user, $bp_settings_updated, $pass_error; ?>
     74        global $bp, $bp_settings_updated, $pass_error;
    7575
     76        $current_user = set_current_user($bp->displayed_user->id);
     77?>
     78
    7679        <?php if ( $bp_settings_updated && !$pass_error ) { ?>
    7780                <div id="message" class="updated fade">
    7881                        <p><?php _e( 'Changes Saved.', 'buddypress' ) ?></p>
     
    8588                </div> 
    8689        <?php } ?>
    8790
    88         <form action="<?php echo $bp->loggedin_user->domain . 'settings/general' ?>" method="post" class="standard-form" id="settings-form">
     91        <form action="<?php echo $bp->displayed_user->domain . 'settings/general' ?>" method="post" class="standard-form" id="settings-form">
    8992                <label for="email"><?php _e( 'Account Email', 'buddypress' ) ?></label>
    90                 <input type="text" name="email" id="email" value="<?php echo attribute_escape( $current_user->user_email ); ?>" class="settings-input" />
    91                        
     93                <p>
     94                        <input type="text" name="email" id="email" value="<?php echo attribute_escape( $current_user->id ); ?>" class="settings-input" />
     95                </p>
     96
    9297                <label for="pass1"><?php _e( 'Change Password <span>(leave blank for no change)</span>', 'buddypress' ) ?></label>
    93                 <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small" /> &nbsp;<?php _e( 'New Password', 'buddypress' ) ?>
    94                 <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" /> &nbsp;<?php _e( 'Repeat New Password', 'buddypress' ) ?>
     98               
     99                <p>
     100                        <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small" /> &nbsp;<?php _e( 'New Password', 'buddypress' ) ?>
     101                        <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" /> &nbsp;<?php _e( 'Repeat New Password', 'buddypress' ) ?>
     102                </p>
    95103       
    96                 <p class="submit"><input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?>" id="submit" class="auto"/></p>
     104                <input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?>" id="submit" class="auto"/>
    97105                <?php wp_nonce_field('bp_settings_general') ?>
    98106        </form>
    99107<?php
     
    102110/***** NOTIFICATION SETTINGS ******/
    103111
    104112function bp_core_screen_notification_settings() {
    105         global $current_user, $bp_settings_updated;
    106        
     113        global $bp, $bp_settings_updated;
     114
     115        $current_user = set_current_user($bp->displayed_user->id);
     116
    107117        $bp_settings_updated = false;
    108118       
    109119        if ( $_POST['submit'] ) {
     
    111121               
    112122                if ( $_POST['notifications'] ) {
    113123                        foreach ( $_POST['notifications'] as $key => $value ) {
    114                                 update_usermeta( (int)$current_user->id, $key, $value );
     124                                update_usermeta( (int)$bp->displayed_user->id, $key, $value );
    115125                        }
    116126                }
    117127               
     
    129139}
    130140
    131141function bp_core_screen_notification_settings_content() {
    132         global $bp, $current_user, $bp_settings_updated; ?>
     142        global $bp, $bp_settings_updated;
     143        $current_user = set_current_user($bp->displayed_user->id);
     144?>
    133145
    134146        <?php if ( $bp_settings_updated ) { ?>
    135147                <div id="message" class="updated fade">
     
    137149                </div>
    138150        <?php } ?>
    139151       
    140         <form action="<?php echo $bp->loggedin_user->domain . 'settings/notifications' ?>" method="post" id="settings-form">
     152        <form action="<?php echo $bp->displayed_user->domain . 'settings/notifications' ?>" method="post" id="settings-form">
    141153                <h3><?php _e( 'Email Notifications', 'buddypress' ) ?></h3>
    142154                <p><?php _e( 'Send a notification by email when:', 'buddypress' ) ?></p>
    143155               
     
    154166/**** DELETE ACCOUNT ****/
    155167
    156168function bp_core_screen_delete_account() {
    157         global $current_user, $bp_settings_updated, $pass_error;
     169        global $bp, $bp_settings_updated, $pass_error;
     170
     171        $current_user = set_current_user($bp->displayed_user->id);
    158172       
    159173        if ( isset( $_POST['delete-account-button'] ) ) {
    160174                check_admin_referer( 'delete-account' );
     
    205219}
    206220
    207221function bp_core_screen_delete_account_content() {
    208         global $bp, $current_user, $bp_settings_updated, $pass_error;   ?>
     222        global $bp, $bp_settings_updated, $pass_error; 
     223       
     224        $current_user = set_current_user($bp->displayed_user->id);
     225?>
    209226
    210         <form action="<?php echo $bp->loggedin_user->domain . 'settings/delete-account'; ?>" name="account-delete-form" id="account-delete-form" class="standard-form" method="post">
     227        <form action="<?php echo $bp->displayed_user->domain . 'settings/delete-account'; ?>" name="account-delete-form" id="account-delete-form" class="standard-form" method="post">
    211228               
    212229                <div id="message" class="info">
    213230                        <p><?php _e( 'WARNING: Deleting your account will completely remove ALL content associated with it. There is no way back, please be careful with this option.', 'buddypress' ); ?></p>