You are here

function fail2ban_form_system_logging_settings_alter in Fail2ban Firewall Integration 7.2

Implements hook_form_FORMID_alter().

Coz we like keeping our extra log facilities.

See also

syslog_form_system_logging_settings_alter().

system_logging_settings().

File

./fail2ban.module, line 98

Code

function fail2ban_form_system_logging_settings_alter(&$form, &$form_state) {

  // According to http://php.net/manual/en/function.openlog.php LOG_AUTHPRIV should be
  // used in preference over LOG_AUTH whenever it is available. So let's check.
  //
  if (defined('LOG_AUTHPRIV')) {
    $facilities = array(
      LOG_AUTHPRIV => 'LOG_AUTHPRIV: security/authorization messages (private)',
    );
  }
  else {
    $facilities = array(
      LOG_AUTH => 'LOG_AUTH: security/authorization messages',
    );
  }

  // Add the rest.
  //
  $facilities += array(
    // LOG_CRON => 'LOG_CRON: clock daemon (cron and at)',
    LOG_DAEMON => 'LOG_DAEMON: other system daemons',
    // LOG_KERN => 'LOG_KERN: kernel messages',
    LOG_LOCAL0 => 'LOG_LOCAL0: reserved for local use, not available in Windows',
    LOG_LOCAL1 => 'LOG_LOCAL1: reserved for local use, not available in Windows',
    LOG_LOCAL2 => 'LOG_LOCAL2: reserved for local use, not available in Windows',
    LOG_LOCAL3 => 'LOG_LOCAL3: reserved for local use, not available in Windows',
    LOG_LOCAL4 => 'LOG_LOCAL4: reserved for local use, not available in Windows',
    LOG_LOCAL5 => 'LOG_LOCAL5: reserved for local use, not available in Windows',
    LOG_LOCAL6 => 'LOG_LOCAL6: reserved for local use, not available in Windows',
    LOG_LOCAL7 => 'LOG_LOCAL7: reserved for local use, not available in Windows',
    // LOG_LPR => 'LOG_LPR: line printer subsystem',
    // LOG_MAIL => 'LOG_MAIL: mail subsystem',
    // LOG_NEWS => 'LOG_NEWS: USENET news subsystem',
    // LOG_SYSLOG => 'LOG_SYSLOG: messages generated internally by syslogd',
    LOG_USER => 'LOG_USER: generic user-level messages',
  );
  if (defined('LOG_LOCAL0')) {
    $form['syslog_facility']['#options'] = $facilities;
  }
}