Ticket #965: site-admin-edit-user-settings.patch
File site-admin-edit-user-settings.patch, 4.8 KB (added by , 15 years ago) |
---|
-
bp-core-settings.php
71 71 } 72 72 73 73 function bp_core_screen_general_settings_content() { 74 global $bp, $ current_user, $bp_settings_updated, $pass_error; ?>74 global $bp, $bp_settings_updated, $pass_error; 75 75 76 $current_user = set_current_user($bp->displayed_user->id); 77 ?> 78 76 79 <?php if ( $bp_settings_updated && !$pass_error ) { ?> 77 80 <div id="message" class="updated fade"> 78 81 <p><?php _e( 'Changes Saved.', 'buddypress' ) ?></p> … … 85 88 </div> 86 89 <?php } ?> 87 90 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"> 89 92 <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 92 97 <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" /> <?php _e( 'New Password', 'buddypress' ) ?> 94 <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" /> <?php _e( 'Repeat New Password', 'buddypress' ) ?> 98 99 <p> 100 <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small" /> <?php _e( 'New Password', 'buddypress' ) ?> 101 <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" /> <?php _e( 'Repeat New Password', 'buddypress' ) ?> 102 </p> 95 103 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"/> 97 105 <?php wp_nonce_field('bp_settings_general') ?> 98 106 </form> 99 107 <?php … … 102 110 /***** NOTIFICATION SETTINGS ******/ 103 111 104 112 function 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 107 117 $bp_settings_updated = false; 108 118 109 119 if ( $_POST['submit'] ) { … … 111 121 112 122 if ( $_POST['notifications'] ) { 113 123 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 ); 115 125 } 116 126 } 117 127 … … 129 139 } 130 140 131 141 function 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 ?> 133 145 134 146 <?php if ( $bp_settings_updated ) { ?> 135 147 <div id="message" class="updated fade"> … … 137 149 </div> 138 150 <?php } ?> 139 151 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"> 141 153 <h3><?php _e( 'Email Notifications', 'buddypress' ) ?></h3> 142 154 <p><?php _e( 'Send a notification by email when:', 'buddypress' ) ?></p> 143 155 … … 154 166 /**** DELETE ACCOUNT ****/ 155 167 156 168 function 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); 158 172 159 173 if ( isset( $_POST['delete-account-button'] ) ) { 160 174 check_admin_referer( 'delete-account' ); … … 205 219 } 206 220 207 221 function 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 ?> 209 226 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"> 211 228 212 229 <div id="message" class="info"> 213 230 <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>