New User Approve - Version 1.3.3

Version Description

  • fix bug showing error message permanently on login page
Download this release

Release Info

Developer picklewagon
Plugin Icon 128x128 New User Approve
Version 1.3.3
Comparing to
See all releases

Code changes from version 1.3.2 to 1.3.3

Files changed (2) hide show
  1. new-user-approve.php +6 -21
  2. readme.txt +5 -2
new-user-approve.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin URI: http://www.picklewagon.com/wordpress/new-user-approve/
5
  Description: This plugin allows administrators to approve users once they register. Only approved users will be allowed to access the blog.
6
  Author: Josh Harrison
7
- Version: 1.3.2
8
  Author URI: http://www.picklewagon.com/
9
  */
10
 
@@ -65,7 +65,7 @@ class pw_new_user_approve {
65
  add_filter('registration_errors', array( $this, 'show_user_message'), 10, 1);
66
  add_filter('login_message', array( $this, 'welcome_user'));
67
  add_filter('screen_layout_columns', array( $this, 'screen_layout_columns'), 10, 2);
68
- add_filter( 'authenticate', array( $this, 'validate_user' ), 30, 3);
69
  }
70
 
71
  public function activation_check() {
@@ -427,27 +427,12 @@ class pw_new_user_approve {
427
  $this->user_page_hook = add_users_page( __('Approve New Users', $this->plugin_id), __('Approve New Users', $this->plugin_id), $cap, $this->_admin_page, array( $this, 'approve_admin' ) );
428
  }
429
 
430
- public function validate_user( $empty, $username, $password ) {
431
- if ( empty( $password ) ) {
432
- return;
433
- }
434
-
435
- if ( empty( $username ) ) {
436
- return;
437
- }
438
-
439
- $user = get_user_by( 'login', $username );
440
-
441
- $result = wp_check_password( $password, $user->user_pass, $user->ID );
442
- if ( !$result ) {
443
- return;
444
- }
445
-
446
- $status = get_user_meta( $user->ID, 'pw_user_status', true );
447
 
448
  if ( empty( $status ) ) {
449
  // the user does not have a status so let's assume the user is good to go
450
- return $user;
451
  }
452
 
453
  $message = false;
@@ -459,7 +444,7 @@ class pw_new_user_approve {
459
  $message = new WP_Error('denied_access', __('<strong>ERROR</strong>: Your account has been denied access to this site.'));
460
  break;
461
  case 'approved':
462
- $message = $user;
463
  break;
464
  }
465
 
4
  Plugin URI: http://www.picklewagon.com/wordpress/new-user-approve/
5
  Description: This plugin allows administrators to approve users once they register. Only approved users will be allowed to access the blog.
6
  Author: Josh Harrison
7
+ Version: 1.3.3
8
  Author URI: http://www.picklewagon.com/
9
  */
10
 
65
  add_filter('registration_errors', array( $this, 'show_user_message'), 10, 1);
66
  add_filter('login_message', array( $this, 'welcome_user'));
67
  add_filter('screen_layout_columns', array( $this, 'screen_layout_columns'), 10, 2);
68
+ add_filter( 'wp_authenticate_user', array( $this, 'authenticate_user' ), 10, 2);
69
  }
70
 
71
  public function activation_check() {
427
  $this->user_page_hook = add_users_page( __('Approve New Users', $this->plugin_id), __('Approve New Users', $this->plugin_id), $cap, $this->_admin_page, array( $this, 'approve_admin' ) );
428
  }
429
 
430
+ public function authenticate_user( $userdata, $password ) {
431
+ $status = get_user_meta( $userdata->ID, 'pw_user_status', true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
432
 
433
  if ( empty( $status ) ) {
434
  // the user does not have a status so let's assume the user is good to go
435
+ return $userdata;
436
  }
437
 
438
  $message = false;
444
  $message = new WP_Error('denied_access', __('<strong>ERROR</strong>: Your account has been denied access to this site.'));
445
  break;
446
  case 'approved':
447
+ $message = $userdata;
448
  break;
449
  }
450
 
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: picklewagon
3
  Donate link: http://picklewagon.com/wordpress/new-user-approve/donate
4
  Tags: users, registration
5
- Requires at least: 3.1
6
  Tested up to: 3.3.2
7
- Stable tag: 1.3.2
8
 
9
  New User Approve is a Wordpress plugin that allows a blog administrator to
10
  approve a user before they are able to access and login to the blog.
@@ -52,6 +52,9 @@ your liking.
52
 
53
  == Changelog ==
54
 
 
 
 
55
  = 1.3.2 =
56
  * fix bug with allowing wrong passwords
57
 
2
  Contributors: picklewagon
3
  Donate link: http://picklewagon.com/wordpress/new-user-approve/donate
4
  Tags: users, registration
5
+ Requires at least: 3.2.1
6
  Tested up to: 3.3.2
7
+ Stable tag: 1.3.3
8
 
9
  New User Approve is a Wordpress plugin that allows a blog administrator to
10
  approve a user before they are able to access and login to the blog.
52
 
53
  == Changelog ==
54
 
55
+ = 1.3.3 =
56
+ * fix bug showing error message permanently on login page
57
+
58
  = 1.3.2 =
59
  * fix bug with allowing wrong passwords
60