<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][3691] trunk: Remove avatar upload before account activation.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd>3691</dd>
<dt>Author</dt> <dd>djpaul</dd>
<dt>Date</dt> <dd>2011-01-09 22:07:17 +0000 (Sun, 09 Jan 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove avatar upload before account activation. Fixes #2741</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcorebpcoresignupphp">trunk/bp-core/bp-core-signup.php</a></li>
<li><a href="#trunkbpthemesbpdefaultregistrationactivatephp">trunk/bp-themes/bp-default/registration/activate.php</a></li>
<li><a href="#trunkbpthemesbpdefaultregistrationregisterphp">trunk/bp-themes/bp-default/registration/register.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcorebpcoresignupphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-signup.php (3690 => 3691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-signup.php        2011-01-09 20:30:25 UTC (rev 3690)
+++ trunk/bp-core/bp-core-signup.php        2011-01-09 22:07:17 UTC (rev 3691)
</span><span class="lines">@@ -155,53 +155,7 @@
</span><span class="cx">
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        $bp->avatar_admin->step = 'upload-image';
-
-        /* If user has uploaded a new avatar */
-        if ( !empty( $_FILES ) ) {
-
-                /* Check the nonce */
-                check_admin_referer( 'bp_avatar_upload' );
-
-                $bp->signup->step = 'completed-confirmation';
-
-                if ( is_multisite() ) {
-                        /* Get the activation key */
-                        if ( !$bp->signup->key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $_POST[ 'signup_username' ], $_POST[ 'signup_email' ] ) ) ) {
-                                bp_core_add_message( __( 'There was a problem uploading your avatar, please try uploading it again', 'buddypress' ) );
-                        } else {
-                                /* Hash the key to create the upload folder (added security so people don't sniff the activation key) */
-                                $bp->signup->avatar_dir = wp_hash( $bp->signup->key );
-                        }
-                } else {
-                        $user_id = bp_core_get_userid( $_POST['signup_username'] );
-                        $bp->signup->avatar_dir = wp_hash( $user_id );
-                }
-
-                /* Pass the file to the avatar upload handler */
-                if ( bp_core_avatar_handle_upload( $_FILES, 'bp_core_signup_avatar_upload_dir' ) ) {
-                        $bp->avatar_admin->step = 'crop-image';
-
-                        /* Make sure we include the jQuery jCrop file for image cropping */
-                        add_action( 'wp_print_scripts', 'bp_core_add_jquery_cropper' );
-                }
-        }
-
-        /* If the image cropping is done, crop the image and save a full/thumb version */
-        if ( isset( $_POST['avatar-crop-submit'] ) ) {
-
-                /* Check the nonce */
-                check_admin_referer( 'bp_avatar_cropstore' );
-
-                /* Reset the avatar step so we can show the upload form again if needed */
-                $bp->signup->step = 'completed-confirmation';
-                $bp->avatar_admin->step = 'upload-image';
-
-                if ( !bp_core_avatar_handle_crop( array( 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) )
-                        bp_core_add_message( __( 'There was a problem cropping your avatar, please try uploading it again', 'buddypress' ), 'error' );
-                else
-                        bp_core_add_message( __( 'Your new avatar was uploaded successfully', 'buddypress' ) );
-        }
</del><ins>+        do_action( 'bp_core_screen_signup' );
</ins><span class="cx">         bp_core_load_template( apply_filters( 'bp_core_template_register', 'registration/register' ) );
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp', 'bp_core_screen_signup', 3 );
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultregistrationactivatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/registration/activate.php (3690 => 3691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/registration/activate.php        2011-01-09 20:30:25 UTC (rev 3690)
+++ trunk/bp-themes/bp-default/registration/activate.php        2011-01-09 22:07:17 UTC (rev 3691)
</span><span class="lines">@@ -1,5 +1,3 @@
</span><del>-<?php /* This template is only used on multisite installations */ ?>
-
</del><span class="cx"> <?php get_header(); ?>
</span><span class="cx">
</span><span class="cx">         <div id="content">
</span><span class="lines">@@ -9,8 +7,6 @@
</span><span class="cx">
</span><span class="cx">                 <div class="page" id="activate-page">
</span><span class="cx">
</span><del>-                        <?php do_action( 'template_notices' ) ?>
-
</del><span class="cx">                         <?php if ( bp_account_was_activated() ) : ?>
</span><span class="cx">
</span><span class="cx">                                 <h2 class="widgettitle"><?php _e( 'Account Activated', 'buddypress' ) ?></h2>
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultregistrationregisterphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/registration/register.php (3690 => 3691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/registration/register.php        2011-01-09 20:30:25 UTC (rev 3690)
+++ trunk/bp-themes/bp-default/registration/register.php        2011-01-09 22:07:17 UTC (rev 3691)
</span><span class="lines">@@ -221,6 +221,7 @@
</span><span class="cx">                                 <h2><?php _e( 'Sign Up Complete!', 'buddypress' ) ?></h2>
</span><span class="cx">
</span><span class="cx">                                 <?php do_action( 'template_notices' ) ?>
</span><ins>+                                <?php do_action( 'bp_before_registration_confirmed' ) ?>
</ins><span class="cx">
</span><span class="cx">                                 <?php if ( bp_registration_needs_activation() ) : ?>
</span><span class="cx">                                         <p><?php _e( 'You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.', 'buddypress' ) ?></p>
</span><span class="lines">@@ -228,57 +229,8 @@
</span><span class="cx">                                         <p><?php _e( 'You have successfully created your account! Please log in using the username and password you have just created.', 'buddypress' ) ?></p>
</span><span class="cx">                                 <?php endif; ?>
</span><span class="cx">
</span><del>-                                <?php if ( bp_is_active( 'xprofile' ) && !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
</del><ins>+                                <?php do_action( 'bp_after_registration_confirmed' ) ?>
</ins><span class="cx">
</span><del>-                                        <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
-
-                                                <h4><?php _e( 'Your Current Avatar', 'buddypress' ) ?></h4>
-                                                <p><?php _e( "We've fetched an avatar for your new account. If you'd like to change this, why not upload a new one?", 'buddypress' ) ?></p>
-
-                                                <div id="signup-avatar">
-                                                        <?php bp_signup_avatar() ?>
-                                                </div>
-
-                                                <p>
-                                                        <input type="file" name="file" id="file" />
-                                                        <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ) ?>" />
-                                                        <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
-                                                        <input type="hidden" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" />
-                                                        <input type="hidden" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" />
-                                                </p>
-
-                                                <?php wp_nonce_field( 'bp_avatar_upload' ) ?>
-
-                                        <?php endif; ?>
-
-                                        <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
-
-                                                <h3><?php _e( 'Crop Your New Avatar', 'buddypress' ) ?></h3>
-
-                                                <img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" />
-
-                                                <div id="avatar-crop-pane">
-                                                        <img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" />
-                                                </div>
-
-                                                <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ) ?>" />
-
-                                                <input type="hidden" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" />
-                                                <input type="hidden" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" />
-                                                <input type="hidden" name="signup_avatar_dir" id="signup_avatar_dir" value="<?php bp_signup_avatar_dir_value() ?>" />
-
-                                                <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src() ?>" />
-                                                <input type="hidden" id="x" name="x" />
-                                                <input type="hidden" id="y" name="y" />
-                                                <input type="hidden" id="w" name="w" />
-                                                <input type="hidden" id="h" name="h" />
-
-                                                <?php wp_nonce_field( 'bp_avatar_cropstore' ) ?>
-
-                                        <?php endif; ?>
-
-                                <?php endif; ?>
-
</del><span class="cx">                         <?php endif; // completed-confirmation signup step ?>
</span><span class="cx">
</span><span class="cx">                         <?php do_action( 'bp_custom_signup_steps' ) ?>
</span></span></pre>
</div>
</div>
</body>
</html>