function og_ui_user_admin_account_submit in Organic groups 7
Submit the user administration update form.
File
- og_ui/
og_ui.admin.inc, line 291 - Admin settings for Organic groups module.
Code
function og_ui_user_admin_account_submit($form, &$form_state) {
$group = $form_state['values']['group'];
$operations = module_invoke_all('og_user_operations', $form, $form_state + array(
'group' => $group,
));
$operation = $operations[$form_state['values']['operation']];
// Filter out unchecked accounts.
$accounts = array_filter($form_state['values']['accounts']);
// If the operation is unblock, block or deny, we make sure the group manager
// isn't being processed, if they were selected.
if (in_array($form_state['values']['operation'], array(
'unblock',
'deny',
'block',
))) {
// Get the entity from group.
$entity = $group
->getEntity();
if (!empty($entity->uid) && in_array($entity->uid, $accounts)) {
// Remove from the accounts array, and give a message.
unset($accounts[$entity->uid]);
drupal_set_message('This update can not be used on the group manager.');
}
}
if ($accounts && ($function = $operation['callback'])) {
// Add in callback arguments if present.
if (isset($operation['callback arguments'])) {
$args = array_merge(array(
$accounts,
), $operation['callback arguments']);
}
else {
$args = array(
$accounts,
);
}
call_user_func_array($function, array(
'gid' => $group->gid,
) + $args);
drupal_set_message(t('The update has been performed.'));
}
}