<!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-&gt;avatar_admin-&gt;step = 'upload-image';
-
-        /* If user has uploaded a new avatar */
-        if ( !empty( $_FILES ) ) {
-
-                /* Check the nonce */
-                check_admin_referer( 'bp_avatar_upload' );
-
-                $bp-&gt;signup-&gt;step = 'completed-confirmation';
-
-                if ( is_multisite() ) {
-                        /* Get the activation key */
-                        if ( !$bp-&gt;signup-&gt;key = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT activation_key FROM {$wpdb-&gt;signups} WHERE user_login = %s AND user_email = %s&quot;, $_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-&gt;signup-&gt;avatar_dir = wp_hash( $bp-&gt;signup-&gt;key );
-                        }
-                } else {
-                        $user_id = bp_core_get_userid( $_POST['signup_username'] );
-                        $bp-&gt;signup-&gt;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-&gt;avatar_admin-&gt;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-&gt;signup-&gt;step = 'completed-confirmation';
-                $bp-&gt;avatar_admin-&gt;step = 'upload-image';
-
-                if ( !bp_core_avatar_handle_crop( array( 'original_file' =&gt; $_POST['image_src'], 'crop_x' =&gt; $_POST['x'], 'crop_y' =&gt; $_POST['y'], 'crop_w' =&gt; $_POST['w'], 'crop_h' =&gt; $_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>-&lt;?php /* This template is only used on multisite installations */ ?&gt;
-
</del><span class="cx"> &lt;?php get_header(); ?&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;div id=&quot;content&quot;&gt;
</span><span class="lines">@@ -9,8 +7,6 @@
</span><span class="cx"> 
</span><span class="cx">                 &lt;div class=&quot;page&quot; id=&quot;activate-page&quot;&gt;
</span><span class="cx"> 
</span><del>-                        &lt;?php do_action( 'template_notices' ) ?&gt;
-
</del><span class="cx">                         &lt;?php if ( bp_account_was_activated() ) : ?&gt;
</span><span class="cx"> 
</span><span class="cx">                                 &lt;h2 class=&quot;widgettitle&quot;&gt;&lt;?php _e( 'Account Activated', 'buddypress' ) ?&gt;&lt;/h2&gt;
</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">                                 &lt;h2&gt;&lt;?php _e( 'Sign Up Complete!', 'buddypress' ) ?&gt;&lt;/h2&gt;
</span><span class="cx"> 
</span><span class="cx">                                 &lt;?php do_action( 'template_notices' ) ?&gt;
</span><ins>+                                &lt;?php do_action( 'bp_before_registration_confirmed' ) ?&gt;
</ins><span class="cx"> 
</span><span class="cx">                                 &lt;?php if ( bp_registration_needs_activation() ) : ?&gt;
</span><span class="cx">                                         &lt;p&gt;&lt;?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' ) ?&gt;&lt;/p&gt;
</span><span class="lines">@@ -228,57 +229,8 @@
</span><span class="cx">                                         &lt;p&gt;&lt;?php _e( 'You have successfully created your account! Please log in using the username and password you have just created.', 'buddypress' ) ?&gt;&lt;/p&gt;
</span><span class="cx">                                 &lt;?php endif; ?&gt;
</span><span class="cx"> 
</span><del>-                                &lt;?php if ( bp_is_active( 'xprofile' ) &amp;&amp; !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?&gt;
</del><ins>+                                &lt;?php do_action( 'bp_after_registration_confirmed' ) ?&gt;
</ins><span class="cx"> 
</span><del>-                                        &lt;?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?&gt;
-
-                                                &lt;h4&gt;&lt;?php _e( 'Your Current Avatar', 'buddypress' ) ?&gt;&lt;/h4&gt;
-                                                &lt;p&gt;&lt;?php _e( &quot;We've fetched an avatar for your new account. If you'd like to change this, why not upload a new one?&quot;, 'buddypress' ) ?&gt;&lt;/p&gt;
-
-                                                &lt;div id=&quot;signup-avatar&quot;&gt;
-                                                        &lt;?php bp_signup_avatar() ?&gt;
-                                                &lt;/div&gt;
-
-                                                &lt;p&gt;
-                                                        &lt;input type=&quot;file&quot; name=&quot;file&quot; id=&quot;file&quot; /&gt;
-                                                        &lt;input type=&quot;submit&quot; name=&quot;upload&quot; id=&quot;upload&quot; value=&quot;&lt;?php _e( 'Upload Image', 'buddypress' ) ?&gt;&quot; /&gt;
-                                                        &lt;input type=&quot;hidden&quot; name=&quot;action&quot; id=&quot;action&quot; value=&quot;bp_avatar_upload&quot; /&gt;
-                                                        &lt;input type=&quot;hidden&quot; name=&quot;signup_email&quot; id=&quot;signup_email&quot; value=&quot;&lt;?php bp_signup_email_value() ?&gt;&quot; /&gt;
-                                                        &lt;input type=&quot;hidden&quot; name=&quot;signup_username&quot; id=&quot;signup_username&quot; value=&quot;&lt;?php bp_signup_username_value() ?&gt;&quot; /&gt;
-                                                &lt;/p&gt;
-
-                                                &lt;?php wp_nonce_field( 'bp_avatar_upload' ) ?&gt;
-
-                                        &lt;?php endif; ?&gt;
-
-                                        &lt;?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?&gt;
-
-                                                &lt;h3&gt;&lt;?php _e( 'Crop Your New Avatar', 'buddypress' ) ?&gt;&lt;/h3&gt;
-
-                                                &lt;img src=&quot;&lt;?php bp_avatar_to_crop() ?&gt;&quot; id=&quot;avatar-to-crop&quot; class=&quot;avatar&quot; alt=&quot;&lt;?php _e( 'Avatar to crop', 'buddypress' ) ?&gt;&quot; /&gt;
-
-                                                &lt;div id=&quot;avatar-crop-pane&quot;&gt;
-                                                        &lt;img src=&quot;&lt;?php bp_avatar_to_crop() ?&gt;&quot; id=&quot;avatar-crop-preview&quot; class=&quot;avatar&quot; alt=&quot;&lt;?php _e( 'Avatar preview', 'buddypress' ) ?&gt;&quot; /&gt;
-                                                &lt;/div&gt;
-
-                                                &lt;input type=&quot;submit&quot; name=&quot;avatar-crop-submit&quot; id=&quot;avatar-crop-submit&quot; value=&quot;&lt;?php _e( 'Crop Image', 'buddypress' ) ?&gt;&quot; /&gt;
-
-                                                &lt;input type=&quot;hidden&quot; name=&quot;signup_email&quot; id=&quot;signup_email&quot; value=&quot;&lt;?php bp_signup_email_value() ?&gt;&quot; /&gt;
-                                                &lt;input type=&quot;hidden&quot; name=&quot;signup_username&quot; id=&quot;signup_username&quot; value=&quot;&lt;?php bp_signup_username_value() ?&gt;&quot; /&gt;
-                                                &lt;input type=&quot;hidden&quot; name=&quot;signup_avatar_dir&quot; id=&quot;signup_avatar_dir&quot; value=&quot;&lt;?php bp_signup_avatar_dir_value() ?&gt;&quot; /&gt;
-
-                                                &lt;input type=&quot;hidden&quot; name=&quot;image_src&quot; id=&quot;image_src&quot; value=&quot;&lt;?php bp_avatar_to_crop_src() ?&gt;&quot; /&gt;
-                                                &lt;input type=&quot;hidden&quot; id=&quot;x&quot; name=&quot;x&quot; /&gt;
-                                                &lt;input type=&quot;hidden&quot; id=&quot;y&quot; name=&quot;y&quot; /&gt;
-                                                &lt;input type=&quot;hidden&quot; id=&quot;w&quot; name=&quot;w&quot; /&gt;
-                                                &lt;input type=&quot;hidden&quot; id=&quot;h&quot; name=&quot;h&quot; /&gt;
-
-                                                &lt;?php wp_nonce_field( 'bp_avatar_cropstore' ) ?&gt;
-
-                                        &lt;?php endif; ?&gt;
-
-                                &lt;?php endif; ?&gt;
-
</del><span class="cx">                         &lt;?php endif; // completed-confirmation signup step ?&gt;
</span><span class="cx"> 
</span><span class="cx">                         &lt;?php do_action( 'bp_custom_signup_steps' ) ?&gt;
</span></span></pre>
</div>
</div>

</body>
</html>