Private
Server IP : 195.201.23.43  /  Your IP : 3.145.28.3
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_vfile.cgi
#!/usr/bin/perl
# save_vfile.cgi
# Save an autoresponder file and alias

require './virtual-server-lib.pl';
&ReadParseMime();
$d = &get_domain($in{'dom'});
&can_edit_domain($d) || &error($text{'aliases_ecannot'});
&can_edit_afiles() || &error($text{'vfile_ecannot'});
$what = $in{'alias'} ? 'alias' : 'user';

# Find the alias and its settings
if ($what eq "alias") {
	@aliases = &list_domain_aliases($d);
	($virt) = grep { $_->{'from'} eq $in{$what} } @aliases;
	}
else {
	@users = &list_domain_users($d);
	($user) = grep { $_->{'user'} eq $in{$what} } @users;
	}

# Validate inputs
$in{'time'} =~ /^\d+$/ || &error($text{'vfile_etime'});
$in{'num'} =~ /^\d+$/ || &error($text{'vfile_enum'});
$in{'dir_def'} || -d $in{'dir'} || &error($text{'vfile_edir'});
$in{'from'} ne 'other' || $in{'other'} =~ /^\S+$/ ||
	&error($text{'vfile_eother'});

# Update the alias
$val = "|$config{'vpopmail_auto'} $in{'time'} $in{'num'} $in{'file'}";
if ($in{'dir_def'}) {
	$val .= " ".$in{'file'}.".log";
	}
else {
	$val .= " ".$in{'dir'};
	}
if ($in{'flag'} ne "") {
	$val .= " ".$in{'flag'};
	}
elsif ($in{'from'} ne "") {
	$val .= " 0";
	}
if ($in{'from'} eq 'other') {
	$val .= " ".$in{'other'};
	}
elsif ($in{'from'} ne '') {
	$val .= " ".$in{'from'};
	}
if ($virt) {
	$virt->{'to'}->[$in{'idx'}] = $val;
	&modify_virtuser($virt, $virt);
	}
else {
	$user->{'to'}->[$in{'idx'}] = $val;
	&modify_user($user, $user, $d);
	}

# Save the file
$in{'text'} =~ s/\r//g;
&open_lock_tempfile(FILE, ">$in{'file'}", 1) ||
	&error(&text('rfile_ewrite', $in{'file'}, $dom->{'user'}, $!));
&print_tempfile(FILE, $in{'text'});
&close_tempfile(FILE);
&run_post_actions_silently();
&webmin_log("save", "vfile", $in{'file'});

&redirect("edit_$what.cgi?$what=$in{$what}&dom=$in{'dom'}&unix=1");

Private