mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-03 22:27:04 +00:00
merge in multisite login, wp-includes, See #11644
git-svn-id: https://develop.svn.wordpress.org/trunk@12697 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+22
-6
@@ -39,7 +39,7 @@ if ( force_ssl_admin() && !is_ssl() ) {
|
||||
* @param WP_Error $wp_error Optional. WordPress Error Object
|
||||
*/
|
||||
function login_header($title = 'Log In', $message = '', $wp_error = '') {
|
||||
global $error, $is_iphone, $interim_login;
|
||||
global $error, $is_iphone, $interim_login, $current_site;
|
||||
|
||||
// Don't index any of these forms
|
||||
add_filter( 'pre_option_blog_public', create_function( '$a', 'return 0;' ) );
|
||||
@@ -74,9 +74,12 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
|
||||
do_action('login_head'); ?>
|
||||
</head>
|
||||
<body class="login">
|
||||
|
||||
<?php if( !is_multisite() ) { ?>
|
||||
<div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', 'http://wordpress.org/'); ?>" title="<?php echo apply_filters('login_headertitle', __('Powered by WordPress')); ?>"><?php bloginfo('name'); ?></a></h1>
|
||||
<?php
|
||||
<?php } else { ?>
|
||||
<div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', 'http://' . $current_site->domain . $current_site->path ); ?>" title="<?php echo apply_filters('login_headertitle', $current_site->site_name ); ?>"><span class="hide"><?php bloginfo('name'); ?></span></a></h1>
|
||||
<?php }
|
||||
|
||||
$message = apply_filters('login_message', $message);
|
||||
if ( !empty( $message ) ) echo $message . "\n";
|
||||
|
||||
@@ -113,7 +116,7 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
|
||||
* @return bool|WP_Error True: when finish. WP_Error on error
|
||||
*/
|
||||
function retrieve_password() {
|
||||
global $wpdb;
|
||||
global $wpdb, $current_site;
|
||||
|
||||
$errors = new WP_Error();
|
||||
|
||||
@@ -162,10 +165,18 @@ function retrieve_password() {
|
||||
$wpdb->update($wpdb->users, array('user_activation_key' => $key), array('user_login' => $user_login));
|
||||
}
|
||||
$message = __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n";
|
||||
$message .= get_option('siteurl') . "\r\n\r\n";
|
||||
if( !is_multisite() ) {
|
||||
$message .= get_option('siteurl') . "\r\n\r\n";
|
||||
} else {
|
||||
$message .= 'http://' . trailingslashit( $current_site->domain . $current_site->path ) . "\r\n\r\n";
|
||||
}
|
||||
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
|
||||
$message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n";
|
||||
$message .= site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . "\r\n";
|
||||
if( !is_multisite() ) {
|
||||
$message .= site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . "\r\n";
|
||||
} else {
|
||||
$message .= 'http://' . trailingslashit( $current_site->domain . $current_site->path ) . "wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login) . "\r\n";
|
||||
}
|
||||
|
||||
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
|
||||
// we want to reverse this for the plain text arena of emails.
|
||||
@@ -398,6 +409,11 @@ case 'rp' :
|
||||
break;
|
||||
|
||||
case 'register' :
|
||||
if( is_multisite() ) {
|
||||
// WPMU doesn't use this
|
||||
wp_redirect( apply_filters( 'wp_signup_location', get_bloginfo('wpurl') . '/wp-signup.php' ) );
|
||||
exit;
|
||||
}
|
||||
if ( !get_option('users_can_register') ) {
|
||||
wp_redirect('wp-login.php?registration=disabled');
|
||||
exit();
|
||||
|
||||
Reference in New Issue
Block a user