403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/home/SERVERWEB/webmin-2.105/webalizer/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/home/SERVERWEB/webmin-2.105/webalizer/mass.cgi
#!/usr/bin/perl
# Mass schedule or de-schedule a bunch of logs

use strict;
use warnings;
no warnings 'redefine';
no warnings 'uninitialized';
our (%text, %config, %gconfig, %access, $module_name, %in, $cron_cmd);
require './webalizer-lib.pl';
&foreign_require("cron", "cron-lib.pl");
&ReadParse();
&error_setup($text{'mass_err'});
$access{'view'} && &error($text{'edit_ecannot'});

# Validate inputs
my @d = split(/\0/, $in{'d'});
@d || &error($text{'mass_enone'});
my @jobs = &cron::list_cron_jobs();
my %job;
foreach my $file (@d) {
	&can_edit_log($file) || &error($text{'edit_efilecannot'});
	($job{$file}) = grep { $_->{'command'} eq "$cron_cmd $file" } @jobs;
	}

my $count = 0;
if ($in{'enable'}) {
	# Add cron jobs for selected
	foreach my $file (@d) {
		my $cfile = &config_file_name($file);
		my $lconf = &get_log_config($file);
		if (!$lconf->{'sched'}) {
			&lock_file($cfile);
			$lconf->{'sched'} = 1;
			my $job = $job{$file};
			if (!$job) {
				$job = { 'user' => 'root',
					 'active' => 1,
					 'command' => "$cron_cmd $file" };
				&lconf_to_cron($lconf, $job);
				&lock_file(&cron::cron_file($job));
				&cron::create_cron_job($job);
				&unlock_file(&cron::cron_file($job));
				}
			&save_log_config($file, $lconf);
			&unlock_file($cfile);
			$count++;
			}
		}
	&webmin_log("enable", "logs", $count);
	}
else {
	# Cancel cron jobs for selected
	foreach my $file (@d) {
		my $cfile = &config_file_name($file);
		my $lconf = &get_log_config($file);
		if ($lconf->{'sched'}) {
			&lock_file($cfile);
			$lconf->{'sched'} = 0;
			my $job = $job{$file};
			if ($job) {
				&lock_file(&cron::cron_file($job));
				&cron::delete_cron_job($job);
				&unlock_file(&cron::cron_file($job));
				}
			&save_log_config($file, $lconf);
			&unlock_file($cfile);
			$count++;
			}
		}
	&webmin_log("disable", "logs", $count);
	}

&redirect("");


Youez - 2016 - github.com/yon3zu
LinuXploit