Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

162 lines (119 sloc) 6.916 kb
<?php
/*
Template Name: Register
*/
// Hackish way to get statuses
if ( isset( $_GET['status'] ) ) {
$status = explode( ',', $_GET['status'] );
} else {
$status = array();
}
get_header(); ?>
<div id="primary">
<div id="content" role="main">
<?php if ( isset( $_GET['wplogin'] ) ) : ?>
<?php if ( 'choose' == $_GET['wplogin'] ) : ?>
<ul>
<li><a href="<?php echo get_bloginfo( 'wpurl' ) . '/register?wplogin=login' ?>">I've already got a w.gorg.es account</a></li>
<li><a href="<?php echo site_url() . '/register?wplogin=apply' ?>">I need to apply for a w.gorg.es account</a></li>
</ul>
<?php elseif ( 'apply' == $_GET['wplogin'] ) : ?>
<p>You can apply for a w.gorg.es account in just a few seconds!</p>
<form name="apply-form" class="standard-form" action="<?php echo add_query_arg( 'wp_apply', '1', site_url( 'register' ) ) ?>" method="post">
<table>
<tr>
<td width="300"><label><?php _e( 'Your name', 'buddypress' ) ?></td>
<td><input type="text" name="display_name" class="input" tabindex="96" />
</label>
<p class="description">This will be the name people see when you leave comments on the site.</p>
</td>
</tr>
<tr>
<td width="300"><label><?php _e( 'Username', 'buddypress' ) ?></td>
<td><input type="text" name="log" class="input" tabindex="97" />
<?php if ( in_array( 'usernameexists', $status ) ) : ?>
<span class="error">That username is already in use. Please try another.</span>
<?php elseif ( in_array( 'usernameinvalid', $status ) ) : ?>
<span class="error">Usernames must have at least four characters, at least one letter, and can only contain letters and numbers.</span>
<?php endif ?>
<p class="description">This will be the username you use to log in. Make sure it has at least four characters, and contains only letters and numbers.</p>
</label></td>
</tr>
<tr>
<td><label><?php _e( 'Email Address', 'buddypress' ) ?></td>
<td><input type="text" name="email" class="input" tabindex="98" />
<?php if ( in_array( 'emailexists', $status ) ) : ?>
<span class="error">That email address is already in use. Please try another.</span>
<?php elseif ( in_array( 'emailinvalid', $status ) ) : ?>
<span class="error">That doesn't appear to be a valid email address.</span>
<?php endif ?>
</label></td>
</tr>
<tr>
<td><label><?php _e( 'Password', 'buddypress' ) ?></td>
<td><input type="password" name="pwd" class="input" value="" tabindex="99" />
<?php if ( in_array( 'failhumancheck', $status ) ) : ?>
<span class="error">Make sure your passwords match</span>
<?php endif ?></label>
</td>
</tr>
<tr>
<td><label><?php _e( 'Password (again)', 'buddypress' ) ?></td>
<td><input type="password" name="pwd_again" class="input" value="" tabindex="99" /></label></td>
</tr>
<tr>
<td><label>What number do you get if you subtract ten from fourteen? <span class="description">(Just making sure you're a human!)</span></td>
<td>
<input type="text" name="humancheck" tabindex="100" />
<?php if ( in_array( 'failhumancheck', $status ) ) : ?>
<span class="error">Try that math again!</span>
<?php endif ?></label>
</td>
</tr>
</table>
<?php wp_nonce_field( 'wallyg_apply' ) ?>
<input type="submit" name="wp-submit" id="sidebar-wp-submit" value="<?php _e( 'Submit', 'buddypress' ); ?>" tabindex="101" />
</form>
<?php else : ?>
<p>Log in with your w.gorg.es username and password.</p>
<form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login_post' ) ?>" method="post">
<p><label><?php _e( 'Username', 'buddypress' ) ?>
<input type="text" name="log" id="sidebar-user-login" class="input" value="<?php if ( isset( $user_login) ) echo esc_attr(stripslashes($user_login)); ?>" tabindex="97" /></label></p>
<p><label><?php _e( 'Password', 'buddypress' ) ?>
<input type="password" name="pwd" id="sidebar-user-pass" class="input" value="" tabindex="98" /></label></p>
<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="sidebar-rememberme" value="forever" tabindex="99" /> <?php _e( 'Remember Me', 'buddypress' ) ?></label></p>
<input type="submit" name="wp-submit" id="sidebar-wp-submit" value="<?php _e( 'Log In', 'buddypress' ); ?>" tabindex="100" />
<input type="hidden" name="testcookie" value="1" />
<input type="hidden" name="redirect_to" value="<?php echo site_url(); ?>" />
</form>
<ul>
<li><a href="<?php echo add_query_arg( 'action', 'lostpassword', wp_login_url() ) ?>">I forgot my username or password!</a></p>
<li><a href="<?php echo site_url() . '/register?wplogin=apply' ?>">I don't have a w.gorg.es account yet.</a></p>
<li><a href="<?php echo site_url() . '/register' ?>">I changed my mind. Can I use my Facebook login instead?</a></li>
</ul>
<?php endif ?>
<?php else : ?>
<?php do_action( 'wally_messages' ) ?>
<?php if ( !is_user_logged_in() ) : ?>
<p>You can log in with your Facebook credentials, or you can use your w.gorg.es account.</p>
<form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login_post' ) ?>" method="post">
<p><label><?php _e( 'Username', 'buddypress' ) ?>
<input type="text" name="log" id="sidebar-user-login" class="input" value="<?php if ( isset( $user_login) ) echo esc_attr(stripslashes($user_login)); ?>" tabindex="97" /></label></p>
<p><label><?php _e( 'Password', 'buddypress' ) ?>
<input type="password" name="pwd" id="sidebar-user-pass" class="input" value="" tabindex="98" /></label></p>
<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="sidebar-rememberme" value="forever" tabindex="99" /> <?php _e( 'Remember Me', 'buddypress' ) ?></label></p>
<input type="submit" name="wp-submit" id="sidebar-wp-submit" value="<?php _e( 'Log In', 'buddypress' ); ?>" tabindex="100" />
<input type="hidden" name="testcookie" value="1" />
<?php $redirect_to = isset( $_GET['redirect_to'] ) ? $_GET['redirect_to'] : site_url() ?>
<input type="hidden" name="redirect_to" value="<?php echo $redirect_to ?>" />
</form>
<ul>
<li><a href="<?php echo add_query_arg( 'action', 'lostpassword', wp_login_url() ) ?>">I forgot my username or password!</a></p>
<li><a href="<?php echo site_url() . '/register?wplogin=apply' ?>">I don't have a w.gorg.es account yet.</a></p>
<li><a href="<?php echo wally_fb_url(); ?>">Log me in using Facebook</a></li>
</ul>
<?php endif ?>
<?php endif ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>
Jump to Line
Something went wrong with that request. Please try again.