Changeset 2059
- Timestamp:
- 10/26/2009 07:03:25 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core.php
r2055 r2059 1546 1546 1547 1547 /* Make sure account deletion is not disabled */ 1548 if ( ( !(int) get_site_option( 'bp-disable-account-deletion' ) && !is_site_admin()) )1548 if ( ( '' != get_site_option( 'bp-disable-account-deletion' ) || (int) get_site_option( 'bp-disable-account-deletion' ) ) && !is_site_admin() ) 1549 1549 return false; 1550 1550 … … 1716 1716 } 1717 1717 1718 /** 1719 * bp_core_boot_spammer() 1720 * 1721 * When a user logs in, check if they have been marked as a spammer. If then simply 1722 * redirect them to the home page and stop them from logging in. 1723 * 1724 * @package BuddyPress Core 1725 * @param $username The username of the user 1726 * @uses delete_usermeta() deletes a row from the wp_usermeta table based on meta_key 1727 */ 1728 function bp_core_boot_spammer( $auth_obj, $username ) { 1729 global $bp; 1730 1731 $user = get_userdatabylogin( $username ); 1732 1733 if ( (int)$user->spam ) 1734 bp_core_redirect( $bp->root_domain ); 1735 } 1736 add_filter( 'authenticate', 'bp_core_boot_spammer', 11, 2 ); 1718 1737 1719 1738 /** -
trunk/bp-core/bp-core-settings.php
r1990 r2059 154 154 /**** DELETE ACCOUNT ****/ 155 155 156 function bp_core_screen_delete_account() { 157 global $current_user, $bp_settings_updated, $pass_error; 158 159 if ( isset( $_POST['delete-account-button'] ) ) { 156 function bp_core_screen_delete_account() { 157 if ( isset( $_POST['delete-account-understand'] ) ) { 160 158 check_admin_referer( 'delete-account' ); 161 159 162 160 // delete the users account 163 161 if ( bp_core_delete_account() ) 164 162 bp_core_redirect( site_url() ); 165 }166 167 $bp_settings_updated = false;168 $pass_error = false;169 170 if ( isset($_POST['submit']) ) {171 check_admin_referer('bp_settings_general');172 173 require_once( WPINC . '/registration.php' );174 175 // Form has been submitted and nonce checks out, lets do it.176 177 if ( $_POST['email'] != '' ) {178 $current_user->user_email = wp_specialchars( trim( $_POST['email'] ));179 }180 181 if ( $_POST['pass1'] != '' && $_POST['pass2'] != '' ) {182 if ( $_POST['pass1'] == $_POST['pass2'] && !strpos( " " . $_POST['pass1'], "\\" ) ) {183 $current_user->user_pass = $_POST['pass1'];184 } else {185 $pass_error = true;186 }187 } else if ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) || !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) {188 $pass_error = true;189 } else {190 unset( $current_user->user_pass );191 }192 193 if ( !$pass_error && wp_update_user( get_object_vars( $current_user ) ) )194 $bp_settings_updated = true;195 163 } 196 164 -
trunk/bp-xprofile.php
r1995 r2059 328 328 /* Loop through the posted fields formatting any datebox values then validate the field */ 329 329 foreach ( $posted_field_ids as $field_id ) { 330 330 331 331 if ( !isset( $_POST['field_' . $field_id] ) ) { 332 333 if ( is set( $_POST['field_' . $field_id . '_day'] ) ) {332 333 if ( is_numeric( $_POST['field_' . $field_id . '_day'] ) ) { 334 334 /* Concatenate the values. */ 335 335 $date_value = $_POST['field_' . $field_id . '_day'] . ' ' . 336 336 $_POST['field_' . $field_id . '_month'] . ' ' . 337 337 $_POST['field_' . $field_id . '_year']; 338 338 339 339 /* Turn the concatenated value into a timestamp */ 340 340 $_POST['field_' . $field_id] = strtotime( $date_value ); 341 341 } 342 342 343 343 } 344 344 345 345 if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST['field_' . $field_id] ) ) 346 346 $errors = true; 347 347 } 348 348 349 349 if ( $errors ) 350 350 bp_core_add_message( __( 'Please make sure you fill in all required fields in this profile field group before saving.', 'buddypress' ), 'error' ); -
trunk/bp-xprofile/bp-xprofile-templatetags.php
r1978 r2059 470 470 471 471 case 'datebox': 472 473 if ( $field->data->value != '') {472 473 if ( !empty( $field->data->value ) ) { 474 474 $day = date("j", $field->data->value); 475 475 $month = date("F", $field->data->value);
Note: See TracChangeset
for help on using the changeset viewer.