From 7e40c36ad8c4e8e173ba175c736a5eb32b7cdd5c Mon Sep 17 00:00:00 2001 From: Sapayth Hossain Date: Thu, 15 Feb 2024 23:29:34 +0600 Subject: [PATCH] fix: pending user can log in --- includes/Free/Simple_Login.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/Free/Simple_Login.php b/includes/Free/Simple_Login.php index bb4270886..a5034ed21 100644 --- a/includes/Free/Simple_Login.php +++ b/includes/Free/Simple_Login.php @@ -473,6 +473,16 @@ public function process_login() { return; } + + $wpuf_user_status = get_user_meta( $user->ID, 'wpuf_user_status', true ); + + if ( 'approved' !== $wpuf_user_status ) { + $message = __( 'You can\'t login until an administrator manually approve your account.', 'wp-user-frontend' ); + + $this->login_errors[] = $message; + + return; + } } else { $creds['user_login'] = $log; }