Private
Server IP : 195.201.23.43  /  Your IP : 3.141.40.192
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_newchroot.cgi
#!/usr/bin/perl
# Save the list of ProFTPd chroot directories

require './virtual-server-lib.pl';
&can_edit_templates() || &error($text{'chroot_ecannot'});
&has_ftp_chroot() || &error($text{'chroot_esupport'});
&error_setup($text{'chroot_err'});
&ReadParse();

# Validate and store inputs
@chroots = ( );
for($i=0; defined($in{"all_$i"}); $i++) {
	next if (!$in{"enabled_$i"});
	$chroot = { };
	if (!$in{"all_$i"}) {
		$chroot->{'group'} = $in{"group_$i"};
		$chroot->{'neg'} = $in{"neg_$i"};
		}
	if ($in{"mode_$i"} == 2) {
		$chroot->{'dir'} = '/';
		}
	elsif ($in{"mode_$i"} == 1) {
		$chroot->{'dir'} = '~';
		}
	elsif ($in{"mode_$i"} == 3) {
		# A domain's home directory
		$chroot->{'group'} || &error(&text('chroot_egroup', $i+1));
		$chroot->{'neg'} && &error(&text('chroot_eneg', $i+1));
		$d = &get_domain_by("group", $chroot->{'group'}, "parent", "");
		$d || &error(&text('chroot_edom', $chroot->{'group'}));
		$chroot->{'dir'} = $d->{'home'};
		}
	elsif ($in{"mode_$i"} == 0) {
		# Other directory
		-d $in{"dir_$i"} ||
		    $in{"dir_$i"} =~ /^\~\/\S+$/ ||
			&error(&text('chroot_edir', $i+1));
		$chroot->{'dir'} =  $in{"dir_$i"};
		}
	push(@chroots, $chroot);
	}

# Really save, and tell the user what is being done
&ui_print_unbuffered_header(undef, $text{'newchroot_title'}, "");

&obtain_lock_ftp();
&$first_print($text{'chroot_saving'});
&save_ftp_chroots(\@chroots);
&$second_print($text{'setup_done'});
&release_lock_ftp();

&run_post_actions();
&webmin_log("chroot");

&ui_print_footer("", $text{'index_return'});
Private