You are here

function clamav_settings_submit in ClamAV 7

Form submission handler for the clamav_admin_settings form.

1 string reference to 'clamav_settings_submit'
clamav_admin_settings in ./clamav.admin.inc
Admin settings page for ClamAV

File

./clamav.admin.inc, line 269
Admin-pages for managing the ClamAV module.

Code

function clamav_settings_submit($form, &$form_state) {

  // Process per-scheme settings.
  $overridden_schemes = array();
  if (isset($form['schemes']['clamav_local_schemes'])) {

    // Any options which were un-checked are overridden.
    foreach ($form_state['values']['clamav_local_schemes'] as $scheme => $val) {
      if ($val === 0) {
        $overridden_schemes[$scheme] = $scheme;
      }
    }
    unset($form_state['values']['clamav_local_schemes']);
  }
  if (isset($form['schemes']['clamav_remote_schemes'])) {

    // Any options which were checked are overridden.
    foreach ($form_state['values']['clamav_remote_schemes'] as $scheme => $val) {
      if ($val !== 0) {
        $overridden_schemes[$scheme] = $scheme;
      }
    }
    unset($form_state['values']['clamav_remote_schemes']);
  }
  variable_set('clamav_overridden_schemes', $overridden_schemes);
}