Changeset 1530
- Timestamp:
- 06/09/2009 08:57:57 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-signup.php
r1503 r1530 1 1 <?php 2 3 function xprofile_clear_signup_cookie() { 4 if ( $_POST['stage'] != 'validate-blog-signup' && $_POST['stage'] != 'validate-user-signup' ) 5 setcookie( 'bp_xprofile_meta', false, time()-1000, COOKIEPATH ); 6 } 7 add_action( 'init', 'xprofile_clear_signup_cookie' ); 2 8 3 9 /************************************************************************** … … 95 101 96 102 extract($result); 97 103 98 104 if ( $bp_signup_has_errors || $bp_signup_avatar_has_errors ) 99 105 $errors->add( 'bp_xprofile_errors', '' ); … … 104 110 105 111 function xprofile_add_profile_meta( $meta ) { 106 global $bp, $bp_blog_signup_meta ;112 global $bp, $bp_blog_signup_meta, $bp_user_signup_meta; 107 113 108 114 if ( $_POST['stage'] == 'validate-blog-signup' ) { 109 115 $bp_meta = $bp_blog_signup_meta; 110 116 } else if ( $_POST['stage'] == 'validate-user-signup' ) { 111 $bp_meta = unserialize( stripslashes( $_COOKIE['bp_xprofile_meta'] ) );117 $bp_meta = $bp_user_signup_meta; 112 118 } else { 113 119 $bp_meta = $meta; … … 124 130 global $current_site, $active_signup; 125 131 global $wp_upload_error; 132 global $bp_user_signup_meta; 126 133 127 134 if ( $_POST['stage'] != 'validate-user-signup' ) return; 128 135 129 136 $counter = 0; 130 137 $bp_signup_has_errors = false; … … 176 183 177 184 // validate the avatar upload if there is one. 178 $ avatar_error= false;185 $bp_signup_avatar_has_errors = false; 179 186 $checked_upload = false; 180 187 $checked_size = false; … … 222 229 } 223 230 224 if ( !$bp_signup_has_errors && !$bp_signup_avatar_has_errors ) { 225 /* Destroy and existing cookies */ 226 setcookie( 'bp_xprofile_meta', false, time()-1000, COOKIEPATH ); 227 231 if ( !$bp_signup_has_errors && !$bp_signup_avatar_has_errors ) { 228 232 $public = (int) $_POST['blog_public']; 229 233 230 234 // put the user profile meta in a session ready to store. 231 235 for ( $i = 0; $i < count($bp_xprofile_callback); $i++ ) { 232 $bp_ meta['field_' . $bp_xprofile_callback[$i]['field_id']] .= $bp_xprofile_callback[$i]['value'];233 } 234 235 $bp_ meta['xprofile_field_ids'] = $_POST['xprofile_ids'];236 $bp_ meta['avatar_image_resized'] = $canvas;237 $bp_ meta['avatar_image_original'] = $original;238 239 setcookie( 'bp_xprofile_meta', serialize($bp_ meta), time()+60*60*24, COOKIEPATH );236 $bp_user_signup_meta['field_' . $bp_xprofile_callback[$i]['field_id']] .= $bp_xprofile_callback[$i]['value']; 237 } 238 239 $bp_user_signup_meta['xprofile_field_ids'] = $_POST['xprofile_ids']; 240 $bp_user_signup_meta['avatar_image_resized'] = $canvas; 241 $bp_user_signup_meta['avatar_image_original'] = $original; 242 243 setcookie( 'bp_xprofile_meta', serialize($bp_user_signup_meta), time()+60*60*24, COOKIEPATH ); 240 244 } 241 245 } … … 246 250 247 251 if ( $_POST['stage'] != 'validate-blog-signup' ) return; 248 252 249 253 $blog_meta = array( 250 254 'public' => $_POST['blog_public'], … … 277 281 278 282 279 function xprofile_on_activate_user( $user_id, $password, $meta ) { 283 function xprofile_on_activate_user( $user_id, $password, $meta ) { 280 284 xprofile_extract_signup_meta( $user_id, $meta ); 281 285
Note: See TracChangeset
for help on using the changeset viewer.