Private
Server IP : 195.201.23.43  /  Your IP : 52.14.205.130
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/virtual-server/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/webmin/virtual-server/save_newsv.cgi
#!/usr/bin/perl
# Update spam and virus scanners across all domains

require './virtual-server-lib.pl';
&ReadParse();
&error_setup($text{'sv_err'});
&can_edit_templates() || &error($text{'sv_ecannot'});

# Validate inputs
if ($config{'spam'}) {
	if ($config{'provision_spam_host'}) {
		# Client and host don't change
		($client, $host, $size) = &get_global_spam_client();
		}
	else {
		# Validate spamassassin program and host system
		$client = $in{'client'};
		&has_command($client) ||
			&error(&text('tmpl_espam',"<tt>$client</tt>"));
		if ($in{'host_def'}) {
			$host = undef;
			}
		else {
			&to_ipaddress($in{'host'}) ||
			    defined(&to_ip6address) &&
			    &to_ip6address($in{'host'}) ||
				&error($text{'tmpl_espam_host'});
			$host = $in{'host'};
			}
		}
	# Validate max size
	if ($in{'size_def'}) {
		$size = undef;
		}
	else {
		$in{'size'} =~ /^\d+$/ || &error($text{'tmpl_espam_size'});
		$size = $in{'size'}*$in{'size_units'};
		}
	if ($client eq "spamc" &&
	    (!$host || $host eq "localhost" ||
	     &to_ipaddress($host) eq &to_ipaddress(&get_system_hostname()))) {
		&find_byname("spamd") || &error($text{'tmpl_espamd'});
		}
	# Validate lookup domain port
	if (!$in{'lookup_port_def'}) {
		$in{'lookup_port'} =~ /^\d+$/ ||
			&error($text{'spam_elookup_port'});
		}
	$oldport = $config{'lookup_domain_port'} || $lookup_domain_port;
	$newport = $in{'lookup_port_def'} ? $lookup_domain_port
					  : $in{'lookup_port'};
	if ($oldport != $newport) {
		# Check if port is in use
		if (&indexof($newport, &list_used_tcp_ports()) >= 0) {
			&error($text{'spam_elookup_port2'});
			}
		}
	}
if ($config{'virus'} && !$config{'provision_virus_host'}) {
	if ($in{'scanner'} == 2) {
		local ($cmd, @args) = &split_quoted_string($in{'scanprog'});
		&has_command($cmd) || &error($text{'spam_escanner'});
		$fullcmd = $in{'scanprog'};
		}
	elsif ($in{'scanner'} == 1) {
		&find_byname("clamd") || &error($text{'spam_eclamdscan'});
		&has_command("clamdscan") || &error($text{'sv_eclamdscan'});
		$fullcmd = "clamdscan";
		}
	elsif ($in{'scanner'} == 0) {
		&has_command("clamscan") || &error($text{'sv_eclamscan'});
		$fullcmd = "clamscan";
		}
	elsif ($in{'scanner'} == 3) {
		&has_command("clamd-stream-client") ||
			&error($text{'sv_estream'});
		$fullcmd = "clamd-stream-client";
		}
	elsif ($in{'scanner'} == 4) {
		&has_command("clamdscan") || &error($text{'sv_eclamdscan'});
		$fullcmd = "clamdscan-remote";
		}
	$in{'vhost_def'} || &to_ipaddress($in{'vhost'}) ||
		&error($text{'sv_evhost'});
	$err = &test_virus_scanner($fullcmd,
				   $in{'vhost_def'} ? undef : $in{'vhost'});
	if ($err) {
		&error(&text('sv_etest', $err));
		}
	}

&obtain_lock_spam_all();

# Update spam scanner
if ($config{'spam'}) {
	&save_global_spam_client($client, $host, $size);
	}

# Update user procmail setting
if ($config{'spam'}) {
	if ($config{'default_procmail'} != $in{'default_procmail'}) {
		$config{'default_procmail'} = $in{'default_procmail'};
		&setup_default_delivery();

		# Save the config
		&lock_file($module_config_file);
		if ($config{'last_check'} < time()) {
			$config{'last_check'} = time()+1;
			}
		&save_module_config();
		&unlock_file($module_config_file);
		}
	}

# Update virus scanner
if ($config{'virus'} && !$config{'provision_virus_host'}) {
	&save_global_virus_scanner($fullcmd,
				   $in{'vhost_def'} ? undef : $in{'vhost'});
	}

# Update bounce behavior
if ($config{'spam'} && defined($in{'exitcode'})) {
	&save_global_quota_exitcode($in{'exitcode'});
	}

# Update lookup domain port
if ($oldport != $newport) {
	&save_lookup_domain_port(
		$in{'lookup_port_def'} ? undef : $in{'lookup_port'});
	}

&release_lock_spam_all();

&set_all_null_print();
&modify_all_webmin();	# Spam setting may have changed
&run_post_actions();

# All done
&webmin_log("sv");
&redirect("");

Private