Add admin email verification screen. Shown every six months after an admin has logged in.

Also includes WPCS fixes for wp-login.php.

Props andraganescu, boemedia, lessbloat, azaozz.
See #46349.

git-svn-id: https://develop.svn.wordpress.org/trunk@45757 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2019-08-07 00:03:39 +00:00
parent bab0d4ee9b
commit 296d8646e7
5 changed files with 580 additions and 242 deletions

View File

@ -131,6 +131,17 @@ p {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
}
.login-action-confirm_admin_email #login {
width: 60vw;
margin-top: -2vh;
}
@media screen and (max-width: 782px) {
.login-action-confirm_admin_email #login {
width: 100vw;
}
}
.login form .forgetmenot {
font-weight: 400;
float: left;
@ -141,6 +152,36 @@ p {
float: right;
}
.login .admin-email-confirm-form .submit {
text-align: center;
}
.admin-email__later {
text-align: left;
}
.login form p.admin-email__details {
margin: 1.1em 0;
}
.login h1.admin-email__heading {
border-bottom: 1px rgb(241, 241, 241) solid;
color: rgb(95, 95, 95);
font-weight: normal;
padding-bottom: 0.5em;
text-align: left;
}
.admin-email__actions div {
padding-top: 1.5em;
}
.login .admin-email__actions .button-primary {
float: none;
margin-left: 0.25em;
margin-right: 0.25em;
}
#login form p {
margin-bottom: 0;
}

View File

@ -815,6 +815,10 @@ function upgrade_all() {
upgrade_510();
}
if ( $wp_current_db_version < 45744 ) {
upgrade_530();
}
maybe_disable_link_manager();
maybe_disable_automattic_widgets();
@ -2114,6 +2118,19 @@ function upgrade_510() {
delete_site_option( 'upgrade_500_was_gutenberg_active' );
}
/**
* Executes changes made in WordPress 5.3.0.
*
* @ignore
* @since 5.3.0
*/
function upgrade_530() {
// Do `add_option()` rather than overwriting with `update_option()` as this may run
// after an admin was redirected to the email verification screen,
// and the option was updated.
add_option( 'admin_email_lifespan', 0 );
}
/**
* Executes network-level upgrade routines.
*

View File

@ -108,7 +108,7 @@ if ( ! is_multisite() ) {
<?php } ?>
<tr>
<th scope="row"><label for="new_admin_email"><?php _e( 'Email Address' ); ?></label></th>
<th scope="row"><label for="new_admin_email"><?php _e( 'Administration Email Address' ); ?></label></th>
<td><input name="new_admin_email" type="email" id="new_admin_email" aria-describedby="new-admin-email-description" value="<?php form_option( 'admin_email' ); ?>" class="regular-text ltr" />
<p class="description" id="new-admin-email-description"><?php _e( 'This address is used for admin purposes. If you change this we will send you an email at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?></p>
<?php

View File

@ -20,7 +20,7 @@ $wp_version = '5.3-alpha-45282-src';
*
* @global int $wp_db_version
*/
$wp_db_version = 44719;
$wp_db_version = 45744;
/**
* Holds the TinyMCE version

File diff suppressed because it is too large Load Diff