Changeset 12021 for trunk/wp-login.php
- Timestamp:
- 10/11/2009 11:26:59 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-login.php
r11930 r12021 40 40 */ 41 41 function login_header($title = 'Log In', $message = '', $wp_error = '') { 42 global $error, $is_iphone ;42 global $error, $is_iphone, $interim_login; 43 43 44 44 // Don't index any of these forms … … 54 54 <title><?php bloginfo('name'); ?> › <?php echo $title; ?></title> 55 55 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> 56 56 <?php 57 57 wp_admin_css( 'login', true ); 58 58 wp_admin_css( 'colors-fresh', true ); 59 59 60 if ( $is_iphone ) { 61 ?> 60 if ( $is_iphone ) { ?> 62 61 <meta name="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" /> 63 62 <style type="text/css" media="screen"> … … 65 64 #login { margin-top: 20px; } 66 65 </style> 67 <?php 66 <?php 67 } elseif ( isset($interim_login) && $interim_login ) { ?> 68 <style type="text/css" media="all"> 69 .login #login { margin: 20px auto; } 70 </style> 71 <?php 68 72 } 69 73 … … 283 287 284 288 // validate action so as to default to the login screen 285 if ( !in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login') ) && false === has_filter('login_form_' . $action) )289 if ( !in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login'), true) && false === has_filter('login_form_' . $action) ) 286 290 $action = 'login'; 287 291 … … 444 448 default: 445 449 $secure_cookie = ''; 450 $interim_login = isset($_REQUEST['interim-login']); 446 451 447 452 // If the user wants ssl but the session is not ssl, force a secure cookie. … … 473 478 474 479 if ( !is_wp_error($user) ) { 480 if ( $interim_login ) { 481 $message = '<p class="message">' . __('You have logged in successfully.') . '</p>'; 482 login_header( '', $message ); ?> 483 <script type="text/javascript">setTimeout( function(){window.close()}, 8000);</script> 484 <p class="alignright"> 485 <input type="button" class="button-primary" value="<?php esc_attr_e('Close'); ?>" onclick="window.close()" /></p> 486 </div></body></html> 487 <?php exit; 488 } 475 489 // If the user can't edit posts, send them to their profile. 476 490 if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) … … 490 504 491 505 // Some parts of this script use the main login form to display a message 492 if ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] ) $errors->add('loggedout', __('You are now logged out.'), 'message'); 493 elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) $errors->add('registerdisabled', __('User registration is currently not allowed.')); 494 elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message'); 495 elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) $errors->add('newpass', __('Check your e-mail for your new password.'), 'message'); 496 elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message'); 506 if ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] ) 507 $errors->add('loggedout', __('You are now logged out.'), 'message'); 508 elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) 509 $errors->add('registerdisabled', __('User registration is currently not allowed.')); 510 elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) 511 $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message'); 512 elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) 513 $errors->add('newpass', __('Check your e-mail for your new password.'), 'message'); 514 elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) 515 $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message'); 516 elseif ( $interim_login ) 517 $errors->add('expired', __('Your session has expired. Please log-in again.'), 'message'); 497 518 498 519 login_header(__('Log In'), '', $errors); … … 516 537 <p class="submit"> 517 538 <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Log In'); ?>" tabindex="100" /> 539 <?php if ( $interim_login ) { ?> 540 <input type="hidden" name="interim-login" value="1" /> 541 <?php } else { ?> 518 542 <input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" /> 543 <?php } ?> 519 544 <input type="hidden" name="testcookie" value="1" /> 520 545 </p> … … 522 547 <?php endif; ?> 523 548 549 <?php if ( !$interim_login ) { ?> 524 550 <p id="nav"> 525 551 <?php if ( isset($_GET['checkemail']) && in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?> … … 532 558 </p> 533 559 560 <p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('← Back to %s'), get_bloginfo('title', 'display' )); ?></a></p> 561 <?php } ?> 534 562 </div> 535 563 536 <p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('← Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>537 538 564 <script type="text/javascript"> 539 <?php if ( $user_login ) { ?>565 <?php if ( $user_login || $interim_login ) { ?> 540 566 setTimeout( function(){ try{ 541 567 d = document.getElementById('user_pass');
Note: See TracChangeset
for help on using the changeset viewer.