Making WordPress.org


Ignore:
Timestamp:
12/04/2016 05:54:55 PM (8 years ago)
Author:
dd32
Message:

Login.WordPress.org: Allow user registration through login.wordpress.org

This change does many things, including, but not limited to:

  • Making all the routes have proper templates, rather than being template-parts
  • Removing all the extra WordPress functionalities and outputs
  • Adding the Registration pages and routes
  • Updating SSO to handle routes with URL params
  • Adding rest endpoints for username/email validation

See #148, #1524

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/index.php

    r4119 r4470  
    66 */
    77
    8 get_header();
     8// Silence is Golden. If we're at this point, then no template exists for the given request yet.
     9wp_safe_redirect( '/' );
    910
    10 /**
    11  * Test if the path we're on is one that we use, depending on if it
    12  * has a partial or not, or load the 404 partial as fallback.
    13  *
    14  * Note that the path is first validated in WP_WPOrg_SSO::redirect_all_login_or_signup_to_sso().
    15  * @see https://meta.trac.wordpress.org/browser/sites/trunk/common/includes/wporg-sso/wp-plugin.php
    16  */
    17 
    18 if ( apply_filters( 'is_valid_wporg_sso_path', false ) && preg_match( '!^(/[^/\?]*)([/\?]{1,2}.*)?$!', $_SERVER['REQUEST_URI'], $matches ) ) {
    19     $screen = '/' === $matches[1] ? 'login' : preg_replace( '/[^a-z0-9-]/', '', $matches[1] );
    20 } else {
    21     $screen = '404';
    22 }
    23 
    24 $partials_dir = __DIR__ . '/partials/';
    25 $partial      = $partials_dir . $screen . '.php';
    26 
    27 if ( file_exists( $partial ) ) {
    28     if ( ! headers_sent() ) {
    29         status_header( 200 );
    30     }
    31     require_once( $partial );
    32 } else {
    33     if ( ! headers_sent() ) {
    34         status_header( 404 );
    35     }
    36     require_once( $partials_dir . '404.php');
    37 }
    38 
    39 get_footer();
Note: See TracChangeset for help on using the changeset viewer.