Changeset 1784
- Timestamp:
- 09/03/2009 07:48:41 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core.php
r1767 r1784 1326 1326 global $bp; 1327 1327 1328 // Be careful with this function! 1329 1328 /* Make sure account deletion is not disabled */ 1329 if ( 1 == (int)get_site_option( 'bp-disable-account-deletion' ) ) 1330 return false; 1331 1330 1332 /* Site admins should not be allowed to delete their accounts */ 1331 1333 if ( is_site_admin() ) 1332 1334 return false; 1333 1335 1334 1336 require_once( ABSPATH . '/wp-admin/includes/mu.php' ); 1335 1337 require_once( ABSPATH . '/wp-admin/includes/user.php' ); -
trunk/bp-core/bp-core-admin.php
r1677 r1784 85 85 </td> 86 86 </tr> 87 <?php } ?> 88 87 <?php } ?> 88 <tr> 89 <th scope="row"><?php _e( 'Disable user account deletion?', 'buddypress' ) ?>:</th> 90 <td> 91 <input type="radio" name="bp-admin[bp-disable-account-deletion]"<?php if ( (int)get_site_option( 'bp-disable-account-deletion' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-account-deletion" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> 92 <input type="radio" name="bp-admin[bp-disable-account-deletion]"<?php if ( !(int)get_site_option( 'bp-disable-account-deletion' ) || '' == get_site_option( 'bp-disable-account-deletion' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-account-deletion" value="0" /> <?php _e( 'No', 'buddypress' ) ?> 93 </td> 94 </tr> 89 95 <?php if ( !locate_template( array( 'registration/register.php' ) ) ) :?> 90 96 <tr> -
trunk/bp-core/bp-core-settings.php
r1718 r1784 22 22 bp_core_new_subnav_item( array( 'name' => __( 'Notifications', 'buddypress' ), 'slug' => 'notifications', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_notification_settings', 'position' => 20, 'user_has_access' => bp_is_home() ) ); 23 23 24 if ( !is_site_admin() )24 if ( !is_site_admin() && 1 != (int)get_site_option( 'bp-disable-account-deletion' ) ) 25 25 bp_core_new_subnav_item( array( 'name' => __( 'Delete Account', 'buddypress' ), 'slug' => 'delete-account', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_delete_account', 'position' => 90, 'user_has_access' => bp_is_home() ) ); 26 26 } … … 36 36 $pass_error = false; 37 37 38 if ( isset($_POST['submit']) && check_admin_referer('bp_settings_general') ) { 38 if ( isset($_POST['submit']) ) { 39 check_admin_referer('bp_settings_general'); 40 39 41 require_once( WPINC . '/registration.php' ); 40 42 … … 105 107 $bp_settings_updated = false; 106 108 107 if ( $_POST['submit'] && check_admin_referer('bp_settings_notifications') ) { 109 if ( $_POST['submit'] ) { 110 check_admin_referer('bp_settings_notifications'); 111 108 112 if ( $_POST['notifications'] ) { 109 113 foreach ( $_POST['notifications'] as $key => $value ) { … … 153 157 global $current_user, $bp_settings_updated, $pass_error; 154 158 155 if ( isset( $_POST['delete-account-button'] ) && check_admin_referer('delete-account') ) { 156 if ( !check_admin_referer( 'delete-account' ) ) 157 return false; 159 if ( isset( $_POST['delete-account-button'] ) ) { 160 check_admin_referer( 'delete-account' ); 158 161 159 162 // delete the users account … … 165 168 $pass_error = false; 166 169 167 if ( isset($_POST['submit']) && check_admin_referer('bp_settings_general') ) { 170 if ( isset($_POST['submit']) ) { 171 check_admin_referer('bp_settings_general'); 172 168 173 require_once( WPINC . '/registration.php' ); 169 174
Note: See TracChangeset
for help on using the changeset viewer.