Skip to:
Content

BuddyPress.org

Changeset 2059


Ignore:
Timestamp:
10/26/2009 07:03:25 PM (15 years ago)
Author:
apeatling
Message:

Merging 1.1 branch updates with trunk

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r2055 r2059  
    15461546
    15471547    /* 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() )
    15491549        return false;
    15501550
     
    17161716}
    17171717
     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 */
     1728function 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}
     1736add_filter( 'authenticate', 'bp_core_boot_spammer', 11, 2 );
    17181737
    17191738/**
  • trunk/bp-core/bp-core-settings.php

    r1990 r2059  
    154154/**** DELETE ACCOUNT ****/
    155155
    156 function bp_core_screen_delete_account() {
    157     global $current_user, $bp_settings_updated, $pass_error;
    158    
    159     if ( isset( $_POST['delete-account-button'] ) ) {
     156function bp_core_screen_delete_account() { 
     157    if ( isset( $_POST['delete-account-understand'] ) ) {
    160158        check_admin_referer( 'delete-account' );
    161        
     159
    162160        // delete the users account
    163161        if ( bp_core_delete_account() )
    164162            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;
    195163    }
    196164   
  • trunk/bp-xprofile.php

    r1995 r2059  
    328328        /* Loop through the posted fields formatting any datebox values then validate the field */
    329329        foreach ( $posted_field_ids as $field_id ) {       
    330            
     330
    331331            if ( !isset( $_POST['field_' . $field_id] ) ) {
    332                
    333                 if ( isset( $_POST['field_' . $field_id . '_day'] ) ) {
     332
     333                if ( is_numeric( $_POST['field_' . $field_id . '_day'] ) ) {
    334334                    /* Concatenate the values. */
    335335                    $date_value = $_POST['field_' . $field_id . '_day'] . ' ' . 
    336336                                  $_POST['field_' . $field_id . '_month'] . ' ' .
    337337                                  $_POST['field_' . $field_id . '_year'];
    338                        
     338
    339339                    /* Turn the concatenated value into a timestamp */
    340340                    $_POST['field_' . $field_id] = strtotime( $date_value );
    341341                }
    342                
     342
    343343            }
    344            
     344
    345345            if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST['field_' . $field_id] ) )
    346346                $errors = true;
    347347        }
    348        
     348
    349349        if ( $errors )
    350350            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  
    470470           
    471471            case 'datebox':
    472            
    473                 if ( $field->data->value != '' ) {
     472
     473                if ( !empty( $field->data->value ) ) {
    474474                    $day = date("j", $field->data->value);
    475475                    $month = date("F", $field->data->value);
Note: See TracChangeset for help on using the changeset viewer.