You are here

function system_site_information_settings_validate in Drupal 6

Same name and namespace in other branches
  1. 7 modules/system/system.admin.inc \system_site_information_settings_validate()

Validate the submitted site-information form.

1 string reference to 'system_site_information_settings_validate'
system_site_information_settings in modules/system/system.admin.inc
Form builder; The general site information form.

File

modules/system/system.admin.inc, line 1211
Admin page callbacks for the system module.

Code

function system_site_information_settings_validate($form, &$form_state) {

  // Validate the e-mail address.
  if ($error = user_validate_mail($form_state['values']['site_mail'])) {
    form_set_error('site_mail', $error);
  }

  // Validate front page path.
  $item = array(
    'link_path' => $form_state['values']['site_frontpage'],
  );
  $normal_path = drupal_get_normal_path($item['link_path']);
  if ($item['link_path'] != $normal_path) {
    drupal_set_message(t('The menu system stores system paths only, but will use the URL alias for display. %link_path has been stored as %normal_path', array(
      '%link_path' => $item['link_path'],
      '%normal_path' => $normal_path,
    )));
    $item['link_path'] = $normal_path;
  }
  if (!empty($item) && !menu_valid_path($item)) {
    form_set_error('site_frontpage', t("The path '@path' is either invalid or you do not have access to it.", array(
      '@path' => $item['link_path'],
    )));
  }
}