diff --git a/all-in-one-wp-security/classes/wp-security-wp-loaded-tasks.php b/all-in-one-wp-security/classes/wp-security-wp-loaded-tasks.php index 091399d..e24b55b 100644 --- a/all-in-one-wp-security/classes/wp-security-wp-loaded-tasks.php +++ b/all-in-one-wp-security/classes/wp-security-wp-loaded-tasks.php @@ -29,7 +29,7 @@ function __construct() { if(!in_array($GLOBALS['pagenow'], array('wp-login.php'))){ self::site_lockout_tasks(); } - }else if(is_user_logged_in() && !current_user_can('manage_options') && !is_admin() && !in_array($GLOBALS['pagenow'], array('wp-login.php')) ){ + }else if(is_user_logged_in() && !current_user_can(AIOWPSEC_MANAGEMENT_PERMISSION) && !is_admin() && !in_array($GLOBALS['pagenow'], array('wp-login.php')) ){ self::site_lockout_tasks(); } } @@ -61,4 +61,4 @@ static function aiowps_login_init(){ } } -} \ No newline at end of file +} diff --git a/all-in-one-wp-security/other-includes/wp-security-rename-login-feature-pre-5-7.php b/all-in-one-wp-security/other-includes/wp-security-rename-login-feature-pre-5-7.php index e2b6549..df1cd04 100644 --- a/all-in-one-wp-security/other-includes/wp-security-rename-login-feature-pre-5-7.php +++ b/all-in-one-wp-security/other-includes/wp-security-rename-login-feature-pre-5-7.php @@ -600,7 +600,7 @@ function retrieve_password() { $redirect_to = admin_url(); } - if ( current_user_can( 'manage_options' ) ) { + if ( current_user_can( AIOWPSEC_MANAGEMENT_PERMISSION ) ) { $admin_email = get_option( 'admin_email' ); } else { wp_safe_redirect( $redirect_to ); @@ -1321,7 +1321,7 @@ function retrieve_password() { } // Check if it is time to add a redirect to the admin email confirmation screen. - if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( 'manage_options' ) ) { + if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( AIOWPSEC_MANAGEMENT_PERMISSION ) ) { $admin_email_lifespan = (int) get_option( 'admin_email_lifespan' ); // If `0` (or anything "falsey" as it is cast to int) is returned, the user will not be redirected diff --git a/all-in-one-wp-security/other-includes/wp-security-rename-login-feature.php b/all-in-one-wp-security/other-includes/wp-security-rename-login-feature.php index 29d9a81..28af8f1 100644 --- a/all-in-one-wp-security/other-includes/wp-security-rename-login-feature.php +++ b/all-in-one-wp-security/other-includes/wp-security-rename-login-feature.php @@ -458,7 +458,7 @@ function wp_login_viewport_meta() { $redirect_to = admin_url(); } - if ( current_user_can( 'manage_options' ) ) { + if ( current_user_can( AIOWPSEC_MANAGEMENT_PERMISSION ) ) { $admin_email = get_option( 'admin_email' ); } else { wp_safe_redirect( $redirect_to ); @@ -1179,7 +1179,7 @@ function wp_login_viewport_meta() { } // Check if it is time to add a redirect to the admin email confirmation screen. - if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( 'manage_options' ) ) { + if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( AIOWPSEC_MANAGEMENT_PERMISSION ) ) { $admin_email_lifespan = (int) get_option( 'admin_email_lifespan' ); // If `0` (or anything "falsey" as it is cast to int) is returned, the user will not be redirected