You are here

function mailhandler_admin_settings_validate in Mailhandler 6

Same name and namespace in other branches
  1. 7 mailhandler.admin.inc \mailhandler_admin_settings_validate()

Validation for mailhandler settings page

1 string reference to 'mailhandler_admin_settings_validate'
mailhandler_admin_settings in ./mailhandler.admin.inc
Return the settings page for mailhandler

File

./mailhandler.admin.inc, line 404
Administrator pages for the Mailhandler module.

Code

function mailhandler_admin_settings_validate($form, &$form_state) {
  if (empty($form_state['values']['mailhandler_max_retrieval'])) {
    $form_state['values']['mailhandler_max_retrieval'] = 0;
  }
  if (!is_numeric($form_state['values']['mailhandler_max_retrieval']) || $form_state['values']['mailhandler_max_retrieval'] < 0 || $form_state['values']['mailhandler_max_retrieval'] != intval($form_state['values']['mailhandler_max_retrieval'])) {
    form_set_error('mailhandler_max_retrieval', t('The value should a positive integer, or zero.'));
  }
}