Skip to content
Permalink
Browse files

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
  • Loading branch information...
azaozz committed Aug 7, 2019
1 parent bab0d4e commit 296d8646e70d0c1b3e41c1fa57a27ccd3a890686
Showing with 575 additions and 237 deletions.
  1. +41 −0 src/wp-admin/css/login.css
  2. +17 −0 src/wp-admin/includes/upgrade.php
  3. +1 −1 src/wp-admin/options-general.php
  4. +1 −1 src/wp-includes/version.php
  5. +515 −235 src/wp-login.php
@@ -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;
}
@@ -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.
*
@@ -108,7 +108,7 @@
<?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
@@ -20,7 +20,7 @@
*
* @global int $wp_db_version
*/
$wp_db_version = 44719;
$wp_db_version = 45744;
/**
* Holds the TinyMCE version

0 comments on commit 296d864

Please sign in to comment.
You can’t perform that action at this time.