diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-12 16:21:15 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-12 16:21:15 +0000 |
commit | 3a4570b0fc8b3d6339bef71d17d7701554e0bbf7 (patch) | |
tree | 2a06e5261263c68d8afd95a6328879dc289cb909 /wp-login.php | |
parent | b83c34a7010faee0223f6037025c350da12e05e6 (diff) | |
download | wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.gz wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.xz wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.zip |
Merge with WP 2.3 - testing use only!
Move pluggable functions out of wpmu-functions and into pluggable.php, fixes #439
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1069 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-login.php')
-rw-r--r-- | wp-login.php | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/wp-login.php b/wp-login.php index 0dd8d6b..f24f5ec 100644 --- a/wp-login.php +++ b/wp-login.php @@ -20,6 +20,8 @@ if ( defined('RELOCATE') ) { // Move flag is set update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) ); } +//Set a cookie now to see if they are supported by the browser. +setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN); // Rather than duplicating this HTML all over the place, we'll stick it in function function login_header($title = 'Login', $message = '') { @@ -31,10 +33,7 @@ function login_header($title = 'Login', $message = '') { <head> <title><?php bloginfo('name'); ?> › <?php echo $title; ?></title> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> - <link rel="stylesheet" href="<?php bloginfo('wpurl'); ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" /> -<?php if ( ('rtl' == $wp_locale->text_direction) ) : ?> - <link rel="stylesheet" href="<?php bloginfo('wpurl'); ?>/wp-admin/rtl.css?version=<?php bloginfo('version'); ?>" type="text/css" /> -<?php endif; ?> + <?php wp_admin_css(); ?> <!--[if IE]><style type="text/css">#login h1 a { margin-top: 35px; } #login #login_error { margin-bottom: 10px; }</style><![endif]--><!-- Curse you, IE! --> <script type="text/javascript"> function focusit() { @@ -80,7 +79,7 @@ case 'logout' : if ( isset( $_REQUEST['redirect_to'] ) ) $redirect_to = $_REQUEST['redirect_to']; - wp_redirect($redirect_to); + wp_safe_redirect($redirect_to); exit(); break; @@ -153,7 +152,7 @@ case 'retrievepassword' : <ul> <?php if (get_option('users_can_register')) : ?> <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Login') ?></a></li> - <li><a href="<?php bloginfo('wpurl'); ?>/signup/"><?php _e('Register') ?></a></li> + <li><a href="<?php bloginfo('wpurl'); ?>/wp-signup.php"><?php _e('Register') ?></a></li> <li><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title')); ?></a></li> <?php else : ?> <li><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title')); ?></a></li> @@ -229,6 +228,10 @@ default: do_action_ref_array('wp_authenticate', array(&$user_login, &$user_pass)); + // If cookies are disabled we can't log in even with a valid user+pass + if ( $_POST && empty($_COOKIE[TEST_COOKIE]) ) + $errors['test_cookie'] = __('<strong>ERROR</strong>: WordPress requires Cookies but your browser does not support them or they are blocked.'); + if ( $user_login && $user_pass && empty( $errors ) ) { $user = new WP_User(0, $user_login); @@ -240,7 +243,7 @@ default: if ( !$using_cookie ) wp_setcookie($user_login, $user_pass, false, '', '', $rememberme); do_action('wp_login', $user_login); - wp_redirect($redirect_to); + wp_safe_redirect($redirect_to); exit(); } else { if ( $using_cookie ) @@ -266,6 +269,7 @@ default: ?> <form name="loginform" id="loginform" action="http://<?php echo $current_blog->domain . $current_blog->path ?>wp-login.php" method="post"> +<?php if ( !in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?> <p> <label><?php _e('Username:') ?><br /> <input type="text" name="log" id="user_login" class="input" value="<?php echo attribute_escape(stripslashes($user_login)); ?>" size="20" tabindex="10" /></label> @@ -280,16 +284,21 @@ default: <input type="submit" name="wp-submit" id="wp-submit" value="<?php _e('Login'); ?> »" tabindex="100" /> <input type="hidden" name="redirect_to" value="<?php echo attribute_escape($redirect_to); ?>" /> </p> +<?php else : ?> + <p> </p> +<?php endif; ?> </form> </div> <ul> -<?php if (get_option('users_can_register')) : ?> - <li><a href="<?php bloginfo('wpurl'); ?>/signup/"><?php _e('Register') ?></a></li> +<?php if ( in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?> + <li><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title', 'display')); ?></a></li> +<?php elseif (get_option('users_can_register')) : ?> + <li><a href="<?php bloginfo('wpurl'); ?>/wp-signup.php"><?php _e('Register') ?></a></li> <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a></li> - <li><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title')); ?></a></li> + <li><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title', 'display')); ?></a></li> <?php else : ?> - <li><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title')); ?></a></li> + <li><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('Back to %s'), get_bloginfo('title', 'display')); ?></a></li> <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a></li> <?php endif; ?> </ul> |