function ad_owner_remove_form_validate in Advertisement 6
Same name and namespace in other branches
- 6.3 owners/ad_owners.module \ad_owner_remove_form_validate()
- 6.2 owners/ad_owners.module \ad_owner_remove_form_validate()
- 7 owners/ad_owners.module \ad_owner_remove_form_validate()
Don't allow the removal of the primary owner of the advertisement.
File
- owners/
ad_owners.module, line 382 - Enhances the ad module to support ad owners.
Code
function ad_owner_remove_form_validate($form, &$form_state) {
$node = node_load($form_state['values']['aid']);
if ($node->uid == $form_state['values']['uid']) {
$owner = user_load(array(
'uid' => $form_state['values']['uid'],
));
drupal_set_message(t('%name is the primary owner of this advertisement. You cannot remove the primary owner.', array(
'%name' => $owner->name,
)), 'error');
$form_state['redirect'] = 'node/' . $form_state['values']['aid'] . '/adowners';
}
}