MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /proc/self/root/usr/libexec/webmin/status/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/libexec/webmin/status/delete_tmpls.cgi
#!/usr/bin/perl
# Delete several templates

require './status-lib.pl';
$access{'edit'} || &error($text{'tmpls_ecannot'});

# Validate inputs
&error_setup($text{'dtmpls_err'});
&ReadParse();
@d = split(/\0/, $in{'d'});
@d || &error($text{'dtmpls_enone'});

# Check for users
@servs = &list_services();
foreach $d (@d) {
	@users = grep { $_->{'tmpl'} eq $d } @servs;
	if (@users) {
		$tmpl = &get_template($d);
		&error(&text('dtmpls_eusers', "<i>$tmpl->{'desc'}</i>",
			join(", ", map { "<i>$_->{'desc'}</i>" } @users)));
		}
	}

# Waste them
foreach $d (@d) {
	$tmpl = &get_template($d);
	if ($tmpl) {
		&delete_template($tmpl);
		}
	}

&webmin_log("deletes", "tmpl", scalar(@d));
&redirect("list_tmpls.cgi");


Anon7 - 2021