diff --git a/userprotect.module b/userprotect.module index 722ea13..456beca 100644 --- a/userprotect.module +++ b/userprotect.module @@ -632,7 +632,7 @@ function userprotect_user_admin_account_validate($form, &$form_state) { form_set_value($form['accounts'][$uid], 0, $form_state); } drupal_set_message(t('%user is protected from status changes, and was not updated.', array('%user' => $account->name)), 'error'); - unset($uids[$uid]); + unset($uids[$key]); unset($form_state['selection'][$key]); unset($form_state['values']['views_bulk_operations'][$key]); } @@ -653,7 +653,7 @@ function userprotect_user_admin_account_validate($form, &$form_state) { unset($form_state['values']['accounts'][$uid]); } drupal_set_message(t('%user is protected from cancellation, and was not cancelled.', array('%user' => $account->name)), 'error'); - unset($uids[$uid]); + unset($uids[$key]); unset($form_state['selection'][$key]); unset($form_state['values']['views_bulk_operations'][$key]); } @@ -675,7 +675,7 @@ function userprotect_user_admin_account_validate($form, &$form_state) { form_set_value($form['accounts'][$uid], 0, $form_state); } drupal_set_message(t('%user is protected from role changes, and was not updated.', array('%user' => $account->name)), 'error'); - unset($uids[$uid]); + unset($uids[$key]); unset($form_state['selection'][$key]); unset($form_state['values']['views_bulk_operations'][$key]); } @@ -686,7 +686,7 @@ function userprotect_user_admin_account_validate($form, &$form_state) { // First check against all edits. if (!userprotect_check_bypass('up_edit') && userprotect_get_user_protection($account, 'up_edit')) { drupal_set_message(t('%user is protected from any changes, and was not updated.', array('%user' => $account->name)), 'error'); - unset($uids[$uid]); + unset($uids[$key]); unset($form_state['selection'][$key]); unset($form_state['values']['views_bulk_operations'][$key]); // Continue to the next user. @@ -706,7 +706,7 @@ function userprotect_user_admin_account_validate($form, &$form_state) { $protection = 'up_' . $property; if (!userprotect_check_bypass($protection) && userprotect_get_user_protection($account, $protection)) { drupal_set_message(t('%user is protected from @property changes, and was not updated.', array('%user' => $account->name, '@property' => $property)), 'error'); - unset($uids[$uid]); + unset($uids[$key]); unset($form_state['selection'][$key]); unset($form_state['values']['views_bulk_operations'][$key]); // Continue to the next user. @@ -717,13 +717,6 @@ function userprotect_user_admin_account_validate($form, &$form_state) { break; } } - - // If we've unset all of the users that were checked, then don't continue - // with the form processing. - if (!count($uids)) { - drupal_set_message(t('No users selected.'), 'error'); - drupal_goto('admin/people'); - } } /**