diff --git a/includes/admin/core/class-admin-notices.php b/includes/admin/core/class-admin-notices.php index f6e6ea09..f3bceaf8 100644 --- a/includes/admin/core/class-admin-notices.php +++ b/includes/admin/core/class-admin-notices.php @@ -37,9 +37,10 @@ if ( ! class_exists( 'Admin_Notices' ) ) { } - /*** - *** @show main notices - ***/ + + /** + * Show main notices + */ function main_notices() { if ( ! defined( 'DOING_AJAX' ) ) { diff --git a/includes/core/class-user.php b/includes/core/class-user.php index d92fba99..03c146cb 100644 --- a/includes/core/class-user.php +++ b/includes/core/class-user.php @@ -70,9 +70,27 @@ if ( ! class_exists( 'User' ) ) { add_action( 'added_existing_user', array( &$this, 'add_um_role_existing_user' ), 10, 2 ); add_action( 'wpmu_activate_user', array( &$this, 'add_um_role_wpmu_new_user' ), 10, 1 ); + + add_action( 'init', array( &$this, 'check_membership' ), 10 ); } + function check_membership() { + if ( ! is_user_logged_in() ) + return; + + um_fetch_user( get_current_user_id() ); + $status = um_user( 'account_status' ); + + if ( 'rejected' == $status ) { + wp_logout(); + exit( wp_redirect( um_get_core_page( 'login' ) ) ); + } + + um_reset_user(); + } + + /** * Multisite add existing user *