Making WordPress.org


Ignore:
Timestamp:
01/18/2016 09:10:41 PM (8 years ago)
Author:
stephdau
Message:

WordPress.org SSO: new custom template handling for login experience.

See #1524: wporg-login theme partof the work.

File:
1 edited

Legend:

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

    r2102 r2313  
    77
    88get_header();
    9 ?>
    109
    11 <div id="pagebody">
    12     <div id="login-welcome" class="wrapper">
    13         <h1><?php _e( 'Welcome!', 'wporg-login' ); ?></h1>
    14         <ul>
    15             <?php if ( is_user_logged_in() ) : ?>
    16                 <li class="button"><a href="<?php echo wp_logout_url(); ?>"><?php _e( 'Log Out', 'wporg-login' ); ?></a></li>
    17             <?php else : ?>
    18                 <li class="button"><a href="<?php echo wp_login_url(); ?>"><?php _e( 'Log In', 'wporg-login' ); ?></a></li>
    19                 <li class="button"><a href="https://wordpress.org/support/register.php"><?php _e( 'Register', 'wporg-login' ); ?></a></li>
    20             <?php endif; ?>
    21         </ul>
    22         <?php /* Could display wp_login_form(); */ ?>
    23     </div>
    24 </div>
     10if ( ! empty( $_GET['screen'] ) ) {
     11    $screen = preg_replace( '/[^a-z0-9-]/', '', $_GET['screen'] );
     12} else if ( preg_match( '/^\/oauth([\/\?]{1}.*)?$/', $_SERVER['REQUEST_URI'] ) ) {
     13    $screen = 'oauth';
     14} else {
     15    $screen = 'login';
     16}
    2517
    26 <?php get_footer(); ?>
     18$partial = __DIR__ . '/partials/' . $screen . '.php';
     19
     20if ( file_exists( $partial ) ) {
     21    require_once( $partial );
     22}
     23
     24get_footer();
Note: See TracChangeset for help on using the changeset viewer.