Uname:Linux server2.hostofiraq.site 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64

Base Dir : /home/iscmbt-kufa-atu/public_html

User : iscmbt-kufa-atu


403WebShell
403Webshell
Server IP : 89.117.53.150  /  Your IP : 216.73.216.11
Web Server : Apache
System : Linux server2.hostofiraq.site 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64
User : iscmbt-kufa-atu ( 1014)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/webmin/nginx/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/webmin/nginx/save_mime.cgi
#!/usr/bin/perl
# Create, save or delete MIME types

use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
&error_setup($text{'mime_err'});
$access{'global'} || &error($text{'index_eglobal'});
&lock_all_config_files();
my $conf = &get_config();
my $http = &find("http", $conf);
my $types = &find("types", $http);
if (!$types) {
	&save_directive($http, [ ], [ { 'name' => 'types',
					'type' => 1,
					'members' => [ ] } ]);
	}

# Validate type name and values
my @words;
if ($in{'new'} || $in{'type'}) {
	$in{'name'} =~ /^[a-z0-9\.\_\-]+\/[a-z0-9\.\_\-]+$/ ||
		&error($text{'mime_ename'});
	@words = split(/\s+/, $in{'words'});
	@words || &error($text{'mime_ewords'});
	foreach my $w (@words) {
		$w =~ /^[a-z0-9\_\-]+$/ || &error($text{'mime_eword'});
		}
	}

# Check for clash
if ($in{'new'} || $in{'type'} && $in{'type'} ne $in{'name'}) {
	my ($clash) = grep { $_->{'name'} eq $in{'name'} }
			   @{$types->{'members'}};
	$clash && &error($text{'mime_eclash'});
	}

my @d;
if ($in{'new'}) {
	# Add a new type
	&save_directive($types, [ ], [ { 'name' => $in{'name'},
					 'words' => \@words } ]);
	}
elsif ($in{'type'}) {
	# Updating some type
	my ($old) = grep { $_->{'name'} eq $in{'type'} } @{$types->{'members'}};
	$old || &error($text{'mime_eold'});
	&save_directive($types, [ $old ], [ { 'name' => $in{'name'},
                                              'words' => \@words } ]);
	}
elsif ($in{'delete'}) {
	# Deleting some rows
	@d = split(/\0/, $in{'d'});
	@d || &error($text{'mime_enone'});
	my @del = ( );
	foreach my $name (@d) {
		my ($d) = grep { $_->{'name'} eq $name } @{$types->{'members'}};
		push(@del, $d) if ($d);
		}
	&save_directive($types, \@del, [ ]);
	}
else {
	# Nothing to do?
	&error($text{'mime_ebutton'});
	}

&flush_config_file_lines();
&unlock_all_config_files();
if ($in{'new'} || $in{'type'}) {
	&webmin_log($in{'new'} ? "create" : "modify", "mime", $in{'name'});
	}
elsif (@d == 1) {
	&webmin_log("delete", "mime", $d[0]);
	}
else {
	&webmin_log("delete", "mimes", scalar(@d));
	}
&redirect("edit_mime.cgi?search=".&urlize($in{'search'}));

Youez - 2016 - github.com/yon3zu
LinuXploit