Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
function administerusersbyrole_user_update(&$edit, $account, $category) {
if ($category === 'account') {
if (!_administerusersbyrole_can_edit_user($account)) {
if (isset($edit['status'])) {
The check for $edit['status'] should go before the call to _administerusersbyrole_can_edit_user(), because it's quicker. That means that if there's no 'status' key in the array, the function exits without bothering to check user access.
Comments
Comment #1
AdamPS CreditAttribution: AdamPS commentedI think this code has now gone from D7 dev version.