Skip to content

Commit 1eaf3cf

Browse files
committed
Fix bulk action nonce verification.
1 parent 02cc708 commit 1eaf3cf

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

assets/js/admin.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66
init: function() {
77
$( document )
88
.on( 'click', 'a.dul-quick-links', SS_DUL.toggleDisabled )
9+
.on( 'ready', SS_DUL.copyNonce )
10+
},
11+
12+
/**
13+
* Clone the nonce field
14+
* @param {*} e
15+
*/
16+
copyNonce: function( e ) {
17+
if ($('input#_dulnonce').length == 0 && $('input#_wpnonce').length == 1) {
18+
let $nonce = $('input#_wpnonce');
19+
let $form = $nonce.parent();
20+
let $newnonce = $nonce.clone().attr('id','_dulnonce').attr('name','_dulnonce');
21+
$form.append($newnonce);
22+
}
923
},
1024

1125
/**

disable-user-login.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Disable User Login
44
* Plugin URI: http://wordpress.org/plugins/disable-user-login
55
* Description: Provides the ability to disable user accounts and prevent them from logging in.
6-
* Version: 1.3.8
6+
* Version: 1.3.9
77
*
88
* Author: Saint Systems
99
* Author URI: https://www.saintsystems.com

includes/class-ss-disable-user-login-plugin.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class SS_Disable_User_Login_Plugin {
1515
*
1616
* @var string
1717
*/
18-
private static $version = '1.3.8';
18+
private static $version = '1.3.9';
1919

2020
/**
2121
* Plugin singleton instance
@@ -449,6 +449,9 @@ public function bulk_action_disable_users($bulk_actions) {
449449
* @since 1.0.6
450450
*/
451451
public function handle_bulk_disable_users( $redirect_to, $doaction, $user_ids ) {
452+
453+
check_admin_referer( 'bulk-users', '_dulnonce' );
454+
452455
if ( $doaction !== 'disable_user_login' && $doaction !== 'enable_user_login' ) {
453456
return $redirect_to;
454457
}

readme.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Tags: users, user, login, account, disable
55
Requires at least: 4.7.0
66
Tested up to: 6.4.2
77
Requires PHP: 5.6
8-
Stable tag: 1.3.8
9-
Version: 1.3.8
8+
Stable tag: 1.3.9
9+
Version: 1.3.9
1010
License: GPLv3
1111

1212
Provides the ability to disable user accounts and prevent them from logging in.
@@ -49,6 +49,9 @@ Yes, there is a filter in place for that, `disable_user_login.disabled_message`.
4949

5050
== Changelog ==
5151

52+
= 1.3.9 =
53+
* Fix bulk action nonce verification.
54+
5255
= 1.3.8 =
5356
* Improved user-specific nonce validation.
5457

0 commit comments

Comments
 (0)