31.12.2016 Views

Signup php

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Main<br />

$active_signup = get_site_option( 'registration', 'none' );<br />

/**<br />

* Filter the type of site sign-up.<br />

*<br />

* @since 3.0.0<br />

*<br />

* @param string $active_signup String that returns registration type. The value can be<br />

* 'all', 'none', 'blog', or 'user'.<br />

*/<br />

$active_signup = apply_filters( 'wpmu_active_signup', $active_signup );<br />

// Make the signup type translatable.<br />

$i18n_signup['all'] = _x('all', 'Multisite active signup type');<br />

$i18n_signup['none'] = _x('none', 'Multisite active signup type');<br />

$i18n_signup['blog'] = _x('blog', 'Multisite active signup type');<br />

$i18n_signup['user'] = _x('user', 'Multisite active signup type');<br />

if ( is_super_admin() )<br />

echo '' . sprintf( __( 'Greetings Site Administrator! You are currently<br />

allowing &#8220;%s&#8221; registrations. To change or disable registration go to your Options page.' ), $i18n_signup[$active_signup],<br />

esc_url( network_admin_url( 'settings.<strong>php</strong>' ) ) ) . '';<br />

$newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '',<br />

$_GET['new'])) : null;<br />

$current_user = wp_get_current_user();<br />

if ( $active_signup == 'none' ) {<br />

_e( 'Registration has been disabled.' );<br />

} elseif ( $active_signup == 'blog' && !is_user_logged_in() ) {<br />

$login_url = wp_login_url( network_site_url( 'wp-signup.<strong>php</strong>' ) );<br />

echo sprintf( __( 'You must first log in, and then you can create a new<br />

site.' ), $login_url );<br />

} else {<br />

$stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default';<br />

switch ( $stage ) {<br />

case 'validate-user-signup' :<br />

if ( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' &&<br />

$active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' )<br />

validate_user_signup();<br />

else<br />

_e( 'User registration has been disabled.' );<br />

break;<br />

case 'validate-blog-signup':<br />

if ( $active_signup == 'all' || $active_signup == 'blog' )<br />

validate_blog_signup();<br />

else<br />

_e( 'Site registration has been disabled.' );<br />

break;<br />

case 'gimmeanotherblog':<br />

validate_another_blog_signup();<br />

break;<br />

case 'default':<br />

default :

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!