You are here

function nodeaccess_grants_form_validate in Nodeaccess 5

Same name and namespace in other branches
  1. 6.2 nodeaccess.module \nodeaccess_grants_form_validate()
  2. 6 nodeaccess.module \nodeaccess_grants_form_validate()
  3. 7 nodeaccess.module \nodeaccess_grants_form_validate()

Validate function for nodeaccess_grants_form.

File

./nodeaccess.module, line 416

Code

function nodeaccess_grants_form_validate($form_id, $form_values) {
  global $form_values;

  // Delete unkept users.
  if (is_array($form_values['uid'])) {
    foreach ($form_values['uid'] as $uid => $row) {
      if (!$row['keep']) {
        unset($form_values['uid'][$uid]);
      }
    }
  }
  if (!$form_values['uid']) {
    unset($form_values['uid']);
  }
}