Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to add extra screen after login asking to confirm admin email #55

Closed

Conversation

draganescu
Copy link

@draganescu draganescu commented Apr 1, 2019

What is it?

This is a PR with a demo of how the "Is your/this admin email still correct" Trac ticket could function.
Reference Trac Ticket ID: 46349 (link)

How it works

  • A new filter function wp_confirm_admin_email hooks into login_redirect
    • and returns the normal redirect, unless
    • the email has not been confirmed in ADMIN_EMAIL_MAX_AGE time
      • The login process is redirected to action=confirm_admin_email
      • Which checks for manage_options
        • redirects to normal redirect if user doesn't have the cap. or
        • displays the admin email confirm form, otherwise
      • The admin email confirm form, in wp-login.php
        • postpones the confirm, with a remind me later link
          • which sets an option named admin_email_lifespan, also
        • submits a confirmed email address
          • which is updated using the same update_option_new_admin_email function used in the options screen
          • sets an option named admin_email_lifespan
    • The user end up redirected to the original intented redirect

How to test

Switch to the branch and update in default-constants.php the ADMIN_EMAIL_MAX_AGE to a number that makes sense for testing. Make sure your local WP is able to send emails. Login and you should see the new screen.


admin-email-double-check


@draganescu draganescu closed this Apr 1, 2019
@draganescu
Copy link
Author

opened draganescu#1 here instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant