WordPress.org

Make WordPress Core

Changeset 12735 for trunk/wp-signup.php


Ignore:
Timestamp:
01/15/2010 11:40:29 PM (10 years ago)
Author:
ryan
Message:

Coding style

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-signup.php

    r12733 r12735  
    99require_once( ABSPATH . WPINC . '/registration.php' );
    1010
    11 if( is_array( get_site_option( 'illegal_names' )) && $_GET[ 'new' ] != '' && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) == true ) {
     11if ( is_array( get_site_option( 'illegal_names' )) && $_GET[ 'new' ] != '' && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) == true ) {
    1212    wp_redirect( "http://{$current_site->domain}{$current_site->path}" );
    1313    die();
     
    2323}
    2424
    25 if( $current_blog->domain . $current_blog->path != $current_site->domain . $current_site->path ) {
     25if ( $current_blog->domain . $current_blog->path != $current_site->domain . $current_site->path ) {
    2626    wp_redirect( "http://" . $current_site->domain . $current_site->path . "wp-signup.php" );
    2727    die();
     
    5757    global $current_site;
    5858    // Blog name
    59     if( !is_subdomain_install() )
     59    if ( !is_subdomain_install() )
    6060        echo '<label for="blogname">' . __('Blog Name:') . '</label>';
    6161    else
     
    6666    <?php }
    6767
    68     if( !is_subdomain_install() ) {
     68    if ( !is_subdomain_install() )
    6969        echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span><input name="blogname" type="text" id="blogname" value="'. esc_attr($blogname) .'" maxlength="50" /><br />';
    70     } else {
     70    else
    7171        echo '<input name="blogname" type="text" id="blogname" value="'.esc_attr($blogname).'" maxlength="50" /><span class="suffix_address">.' . $current_site->domain . $current_site->path . '</span><br />';
    72     }
     72
    7373    if ( !is_user_logged_in() ) {
    7474        print '(<strong>' . __( 'Your address will be ' );
    75         if( !is_subdomain_install() ) {
     75        if ( !is_subdomain_install() )
    7676            print $current_site->domain . $current_site->path . __( 'blogname' );
    77         } else {
     77        else
    7878            print __( 'domain.' ) . $current_site->domain . $current_site->path;
    79         }
    8079        echo '.</strong> ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)' ) . '</p>';
    8180    }
     
    9695            <div style="clear:both;"></div>
    9796            <label class="checkbox" for="blog_public_on">
    98                 <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if( !isset( $_POST['blog_public'] ) || $_POST['blog_public'] == '1' ) { ?>checked="checked"<?php } ?> />
     97                <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if ( !isset( $_POST['blog_public'] ) || $_POST['blog_public'] == '1' ) { ?>checked="checked"<?php } ?> />
    9998                <strong><?php _e( 'Yes' ); ?></strong>
    10099            </label>
    101100            <label class="checkbox" for="blog_public_off">
    102                 <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if( isset( $_POST['blog_public'] ) && $_POST['blog_public'] == '0' ) { ?>checked="checked"<?php } ?> />
     101                <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if ( isset( $_POST['blog_public'] ) && $_POST['blog_public'] == '0' ) { ?>checked="checked"<?php } ?> />
    103102                <strong><?php _e( 'No' ); ?></strong>
    104103            </label>
     
    191190    global $wpdb, $current_user, $blogname, $blog_title, $errors, $domain, $path;
    192191    $current_user = wp_get_current_user();
    193     if( !is_user_logged_in() )
     192    if ( !is_user_logged_in() )
    194193        die();
    195194
     
    226225    if ( !is_wp_error($errors) )
    227226        $errors = new WP_Error();
    228     if( isset( $_POST[ 'signup_for' ] ) ) {
     227    if ( isset( $_POST[ 'signup_for' ] ) )
    229228        $signup[ wp_specialchars( $_POST[ 'signup_for' ] ) ] = 'checked="checked"';
    230     } else {
     229    else
    231230        $signup[ 'blog' ] = 'checked="checked"';
    232     }
    233231
    234232    // allow definition of default variables
     
    247245
    248246        <p>
    249         <?php if( $active_signup == 'blog' ) { ?>
     247        <?php if ( $active_signup == 'blog' ) { ?>
    250248            <input id="signupblog" type="hidden" name="signup_for" value="blog" />
    251         <?php } elseif( $active_signup == 'user' ) { ?>
     249        <?php } elseif ( $active_signup == 'user' ) { ?>
    252250            <input id="signupblog" type="hidden" name="signup_for" value="user" />
    253251        <?php } else { ?>
     
    370368// Main
    371369$active_signup = get_site_option( 'registration' );
    372 if( !$active_signup )
     370if ( !$active_signup )
    373371    $active_signup = 'all';
    374372
    375373$active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user"
    376374
    377 if( is_super_admin() )
     375if ( is_super_admin() )
    378376    echo '<div class="mu_alert">' . sprintf( __( "Greetings Site Administrator! You are currently allowing '%s' registrations. To change or disable registration go to your <a href='wp-admin/ms-options.php'>Options page</a>." ), $active_signup ) . '</div>';
    379377
     
    381379
    382380$current_user = wp_get_current_user();
    383 if( $active_signup == "none" ) {
     381if ( $active_signup == "none" ) {
    384382    _e( "Registration has been disabled." );
    385 } elseif( $active_signup == 'blog' && !is_user_logged_in() ){
    386     if( is_ssl() ) {
     383} elseif ( $active_signup == 'blog' && !is_user_logged_in() ) {
     384    if ( is_ssl() )
    387385        $proto = 'https://';
    388     } else {
     386    else
    389387        $proto = 'http://';
    390     }
    391388    $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode($proto . $_SERVER['HTTP_HOST'] . '/wp-signup.php' ));
    392389    echo sprintf( __( "You must first <a href=\"%s\">login</a>, and then you can create a new blog."), $login_url );
     
    400397        break;
    401398        case 'validate-blog-signup':
    402             if( $active_signup == 'all' || $active_signup == 'blog' )
     399            if ( $active_signup == 'all' || $active_signup == 'blog' )
    403400                validate_blog_signup();
    404401            else
     
    411408            $user_email = $_POST[ 'user_email' ];
    412409            do_action( "preprocess_signup_form" ); // populate the form from invites, elsewhere?
    413             if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) {
     410            if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) )
    414411                signup_another_blog($newblogname);
    415             } elseif( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) ) {
     412            elseif( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) )
    416413                signup_user( $newblogname, $user_email );
    417             } elseif( is_user_logged_in() == false && ( $active_signup == 'blog' ) ) {
     414            elseif( is_user_logged_in() == false && ( $active_signup == 'blog' ) )
    418415                _e( "I'm sorry. We're not accepting new registrations at this time." );
    419             } else {
     416            else
    420417                _e( "You're logged in already. No need to register again!" );
    421             }
     418
    422419            if ($newblogname) {
    423                 if( !is_subdomain_install() )
     420                if ( !is_subdomain_install() )
    424421                    $newblog = 'http://' . $current_site->domain . $current_site->path . $newblogname . '/';
    425422                else
    426423                    $newblog = 'http://' . $newblogname . '.' . $current_site->domain . $current_site->path;
    427                 if ($active_signup == 'blog' || $active_signup == 'all')
     424                if ( $active_signup == 'blog' || $active_signup == 'all' )
    428425                    printf(__("<p><em>The blog you were looking for, <strong>%s</strong> doesn't exist but you can create it now!</em></p>"), $newblog );
    429426                else
Note: See TracChangeset for help on using the changeset viewer.