Inform the user when cookies are disabled and login fails. Fixed #2039 props tellyworth.
git-svn-id: https://develop.svn.wordpress.org/trunk@6009 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d0d887d09d
commit
187574db35
@ -20,6 +20,8 @@ if ( defined('RELOCATE') ) { // Move flag is set
|
|||||||
update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );
|
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
|
// Rather than duplicating this HTML all over the place, we'll stick it in function
|
||||||
function login_header($title = 'Login', $message = '') {
|
function login_header($title = 'Login', $message = '') {
|
||||||
@ -307,6 +309,10 @@ default:
|
|||||||
|
|
||||||
do_action_ref_array('wp_authenticate', array(&$user_login, &$user_pass));
|
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 ) ) {
|
if ( $user_login && $user_pass && empty( $errors ) ) {
|
||||||
$user = new WP_User(0, $user_login);
|
$user = new WP_User(0, $user_login);
|
||||||
|
|
||||||
|
@ -206,6 +206,8 @@ if ( !defined('USER_COOKIE') )
|
|||||||
define('USER_COOKIE', 'wordpressuser_'. COOKIEHASH);
|
define('USER_COOKIE', 'wordpressuser_'. COOKIEHASH);
|
||||||
if ( !defined('PASS_COOKIE') )
|
if ( !defined('PASS_COOKIE') )
|
||||||
define('PASS_COOKIE', 'wordpresspass_'. COOKIEHASH);
|
define('PASS_COOKIE', 'wordpresspass_'. COOKIEHASH);
|
||||||
|
if ( !defined('TEST_COOKIE') )
|
||||||
|
define('TEST_COOKIE', 'wordpress_test_cookie');
|
||||||
if ( !defined('COOKIEPATH') )
|
if ( !defined('COOKIEPATH') )
|
||||||
define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
|
define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
|
||||||
if ( !defined('SITECOOKIEPATH') )
|
if ( !defined('SITECOOKIEPATH') )
|
||||||
|
Loading…
Reference in New Issue
Block a user