Private
Server IP : 195.201.23.43  /  Your IP : 3.22.187.118
Web Server : Apache
System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64
User : kdecoratie ( 1041)
PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/webmin/syslog-ng/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/webmin/syslog-ng/save_options.cgi
#!/usr/bin/perl
# Update global options

require './syslog-ng-lib.pl';
&ReadParse();
$conf = &get_config();
$options = &find("options", $conf);
$options ||= { 'name' => 'options',
	       'type' => 1,
	       'values' => [ ],
	       'members' => [ ] };
$mems = $options->{'members'};
&error_setup($text{'options_err'});

# Validate and store inputs
&save_yesno_option("use_fqdn");
&save_yesno_option("check_hostname");
&save_yesno_option("keep_hostname");
&save_yesno_option("chain_hostnames");
&save_optional_option("bad_hostname", '\S');

&save_yesno_option("use_dns");
&save_yesno_option("dns_cache");
&save_optional_option("dns_cache_size", '^\d+$');
&save_optional_option("dns_cache_expire", '^\d+$');
&save_optional_option("dns_cache_expire_failed", '^\d+$');

&save_optional_option("owner", '\S');
&save_optional_option("group", '\S');
&save_optional_option("perm", '^[0-7]+$');
&save_yesno_option("create_dirs");
&save_optional_option("dir_owner", '\S');
&save_optional_option("dir_group", '\S');
&save_optional_option("dir_perm", '^[0-7]+$');

&save_optional_option("time_reopen", '^\d+$');
&save_optional_option("time_reap", '^\d+$');
&save_optional_option("sync", '^\d+$');
&save_optional_option("stats", '^\d+$');
&save_optional_option("log_fifo_size", '^\d+$');
&save_yesno_option("use_time_recvd");
&save_optional_option("log_msg_size", '^\d+$');
&save_yesno_option("sanitize_filenames");

# Write out options section
&lock_all_files($conf);
&save_directive($conf, undef, "options", $options, 0);
&unlock_all_files();
&webmin_log("options");

&redirect("");

sub save_yesno_option
{
local ($name) = @_;
local $dir = $in{$name} ?
	{ 'name' => $name,
	  'type' => 0,
	  'values' => [ $in{$name} ] } : undef;
&save_directive($conf, $options, $name, $dir, 1);
}

sub save_optional_option
{
local ($name, $re) = @_;
if ($in{$name."_def"}) {
	&save_directive($conf, $options, $name, undef, 1);
	}
else {
	!$re || $in{$name} =~ /$re/ || &error($text{'options_e'.$name});
	local $dir = { 'name' => $name,
		       'type' => 0,
		       'values' => [ $in{$name} ] };
	&save_directive($conf, $options, $name, $dir, 1);
	}
}

Private