[ Avaa Bypassed ]




Upload:

Command:

www-data@18.227.49.56: ~ $
#!/usr/bin/perl
# edit_log.cgi
# Show a form for creating or editing a log

require './logrotate-lib.pl';
&ReadParse();
$conf = &get_config();
if ($in{'global'}) {
	&ui_print_header(undef, $text{'global_title'}, "", "global");
	$lconf = $conf;
	}
elsif ($in{'new'}) {
	&ui_print_header(undef, $text{'edit_title2'}, "", "create");
	$log = $conf->[$in{'clone'}], $lconf = $log->{'members'}
	    if ($in{'clone'});
	}
else {
	&ui_print_header(undef, $text{'edit_title1'}, "", "edit");
	$log = $conf->[$in{'idx'}];
	$lconf = $log->{'members'};
	}

print &ui_form_start("save_log.cgi", "post");
print &ui_hidden("new", $in{'new'}),"\n";
print &ui_hidden("idx", $in{'idx'}),"\n";
print &ui_hidden("global", $in{'global'}),"\n";

if (!$in{'global'}) {
	print &ui_table_start($text{'edit_header'}, "width=100%", 2);
	print &ui_table_row($text{'edit_file'},
			    &ui_textarea("file",
				join("\n", @{$log->{'name'}}), 3, 60)." ".
			    &file_chooser_button("file"));
	}
else {
	print &ui_table_start($text{'global_header'}, "width=100%", 2);
	}

$period = &get_period($lconf);
$defperiod = &get_period($conf) if (!$in{'global'});
$dptext = $text{"period_".$defperiod} || $text{'period_never'};
print &ui_table_row($text{'edit_sched'},
		    &ui_select("sched", $period,
				[ [ '', &deftext($dptext)  ],
				  [ 'daily', $text{'period_daily'} ],
				  [ 'weekly', $text{'period_weekly'} ],
				  [ 'monthly', $text{'period_monthly'} ] ]));

$size = &find_value("size", $lconf);
print &ui_table_row($text{'edit_size'},
		    &ui_opt_textbox("size", $size, 10,
				    &deftext(&find_default("size") ||
					     $text{'period_never'})).
		    " ".$text{'period_bytes'});

$minsize = &find_value("minsize", $lconf);
print &ui_table_row($text{'edit_minsize'},
		    &ui_opt_textbox("minsize", $minsize, 10,
				    &deftext(&find_default("minsize") ||
					     $text{'edit_nominsize'})).
		    " ".$text{'period_bytes'});

print &ui_table_hr();

$rotate = &find_value("rotate", $lconf);
print &ui_table_row($text{'edit_rotate'},
		    &ui_opt_textbox("rotate", $rotate, 5,
				    &deftext(&find_default("rotate"))));

&yesno_option("compress", "nocompress", $lconf);
&yesno_option("delaycompress", "nodelaycompress", $lconf);
&yesno_option("copytruncate", "nocopytruncate", $lconf);
&yesno_option("ifempty", "notifempty", $lconf);
&yesno_option("missingok", "nomissingok", $lconf);

print &ui_table_hr();

$create = &find_value("create", $lconf);
$nocreate = &find("nocreate", $lconf);
($mode, $user, $group) = split(/\s+/, $create);
$dcr = &find_default("create");
@crinputs = ( "createmode", "createuser", "creategroup" );
print &ui_table_row($text{'edit_create'},
    &ui_radio("create", defined($create) ? 2 : $nocreate ? 1 : 0,
	      [ [ 2, &text('edit_createas',
		   &ui_textbox("createmode", $mode, 4, !defined($create)),
		   &ui_user_textbox("createuser", $user, 0,
				    !defined($create)),
		   &ui_group_textbox("creategroup", $group, 0,
				     !defined($create)))."<br>",
		   &js_disable_inputs([ ], \@crinputs, "onClick") ],
		[ 1, $text{'edit_createno'}."<br>",
		  &js_disable_inputs(\@crinputs, [ ], "onClick") ],
		[ 0, &deftext($dcr ne '' ? $dcr :
		      defined($dcr) ? $text{'edit_createsame'} :
				$text{'edit_createno'}),
		  &js_disable_inputs(\@crinputs, [ ], "onClick") ] ]));

$olddir = &find_value("olddir", $lconf);
$noolddir = &find("noolddir", $lconf);
print &ui_table_row($text{'edit_olddir'},
    &ui_radio("olddir", $olddir ? 2 : $noolddir ? 1 : 0,
	      [ [ 2, $text{'edit_olddirto'}." ".
		     &ui_textbox("olddirto", $olddir, 30, !$olddir)." ".
		     &file_chooser_button("olddirto", 1)."<br>",
		  &js_disable_inputs([ ], [ "olddirto" ], "onClick") ],
		[ 1, $text{'edit_olddirsame'}."<br>",
		  &js_disable_inputs([ "olddirto" ], [ ], "onClick") ],
		[ 0, &deftext(&find_default("olddir") ||
			      $text{'edit_olddirsame'}),
		  &js_disable_inputs([ "olddirto" ], [ ], "onClick") ] ]));

$ext = &find_value("extension", $lconf);
print &ui_table_row($text{'edit_ext'},
    &ui_opt_textbox("ext", $ext, 10,
		    &deftext(&find_default("ext"))));

&yesno_option("dateext", "nodateext", $lconf);

print &ui_table_hr();

$mail = &find_value("mail", $lconf);
$nomail = &find("nomail", $lconf);
$mmode = $mail ? 2 : $nomail ? 1 : 0;
print &ui_table_row($text{'edit_mail'},
	    &ui_radio("mail", $mmode,
		      [ [ 2, $text{'edit_mailto'}." ".
			     &ui_textbox("mailto", $mail, 30, $mmode != 2).
			     "<br>",
			     &js_disable_inputs([ ], [ "mailto" ], "onClick") ],
			[ 1, $text{'edit_mailno'}."<br>",
			  &js_disable_inputs([ "mailto" ], [ ], "onClick") ],
			[ 0, &deftext(&find_default("mail") ||
				      $text{'edit_mailno'}),
			  &js_disable_inputs([ "mailto" ], [ ], "onClick") ] ]));

$mailfirst = &find("mailfirst", $lconf);
$maillast = &find("maillast", $lconf);
print &ui_table_row($text{'edit_mailfl'},
		    &ui_radio("mailfirst", $mailfirst ? 2 : $maillast ? 1 : 0,
			      [ [ 2, $text{'edit_mailfirst'}."<br>" ],
				[ 1, $text{'edit_maillast'}."<br>" ],
				[ 0, &deftext(defined(
					&find_default("mailfirst")) ?
						$text{'edit_mailfirst'} :
						$text{'edit_maillast'}) ] ]));

if (&compare_version_numbers(&get_logrotate_version(), 3.6) < 0) {
	$errors = &find_value("errors", $lconf);
	print &ui_table_row($text{'edit_errors'},
			    &ui_opt_textbox("errors", $errors, 30,
				    &deftext(&find_default("errors") ||
					     $text{'edit_errorsno'})."<br>",
				    $text{'edit_errorsto'}));
	}

print &ui_table_hr();

$pre = &find_value("prerotate", $lconf);
print &ui_table_row($text{'edit_pre'},
		    &ui_textarea("pre", $pre, 3, 60));

$post = &find_value("postrotate", $lconf);
print &ui_table_row($text{'edit_post'},
		    &ui_textarea("post", $post, 3, 60));

if (&compare_version_numbers(&get_logrotate_version(), 3.4) >= 0) {
	&yesno_option("sharedscripts", "nosharedscripts", $lconf);
	}

print &ui_table_end();
if ($in{'global'}) {
	print &ui_form_end([ [ 'save', $text{'save'} ] ], "100%");
	}
elsif ($in{'new'}) {
	print &ui_form_end([ [ 'create', $text{'create'} ] ], "100%");
	}
else {
	print &ui_form_end([ [ 'save', $text{'save'} ],
			     [ 'now', $text{'edit_now'} ],
			     [ 'delete', $text{'delete'} ] ], "100%");

	print &ui_form_start("edit_log.cgi",
	    undef, undef, undef, 'ui_form ui_table_end_submit_right');
	print &ui_hidden("clone", $in{'idx'});
	print &ui_hidden("new", 1);
	print &ui_submit($text{'edit_clone'});
	print &ui_form_end();
	}

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

# yesno_option(name1, name2, &conf)
sub yesno_option
{
local $y = &find($_[0], $_[2]);
local $n = &find($_[1], $_[2]);
local $yd = &find_default($_[0]);
local $nd = &find_default($_[1]);
print &ui_table_row($text{'edit_'.$_[0]},
		    &ui_radio($_[0], $y ? 2 : $n ? 1 : 0,
			      [ [ 2, $text{'yes'} ],
			 	[ 1, $text{'no'} ],
			 	[ 0, &deftext(defined($yd) ? $text{'yes'} : $text{'no'}) ] ]), 1);
}

# find_default(name, [global])
sub find_default
{
if ($in{'global'} || $_[1]) {
	# Return global hard-coded default
	return $global_default{$_[0]};
	}
else {
	# Look at global first
	local $rv = &find_value($_[0], $conf);
	return $rv if (defined($rv));
	return &find_default($_[0], 1);
	}
}

sub deftext
{
return $_[0] ? &text('edit_default', $_[0]) : $text{'default'};
}

Filemanager

Name Type Size Permission Actions
help Folder 0755
images Folder 0755
lang Folder 0755
CHANGELOG File 528 B 0644
backup_config.pl File 630 B 0755
cgi_args.pl File 221 B 0755
config File 67 B 0644
config-ALL-linux File 67 B 0644
config-debian-linux File 93 B 0644
config-freebsd File 142 B 0644
config-open-linux File 71 B 0644
config-redhat-linux File 93 B 0644
config-solaris-10-ALL File 132 B 0644
config-syno-linux File 67 B 0644
config.info File 288 B 0644
config.info.ca File 358 B 0644
config.info.cs File 342 B 0644
config.info.de File 345 B 0644
config.info.es File 272 B 0644
config.info.fr File 390 B 0644
config.info.hu File 0 B 0644
config.info.ja File 398 B 0644
config.info.ko File 276 B 0644
config.info.nl File 321 B 0644
config.info.no File 325 B 0644
config.info.pl File 334 B 0644
config.info.sk File 356 B 0644
config.info.tr File 288 B 0644
delete_logs.cgi File 642 B 0755
edit_log.cgi File 7.12 KB 0755
edit_sched.cgi File 1.4 KB 0755
force.cgi File 619 B 0755
index.cgi File 3.34 KB 0755
install_check.pl File 331 B 0755
log_parser.pl File 605 B 0755
logrotate-lib.pl File 9.36 KB 0755
module.info File 203 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 132 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 186 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 226 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 223 B 0644
module.info.ca File 145 B 0644
module.info.ca.auto File 17 B 0644
module.info.cs File 32 B 0644
module.info.cs.auto File 114 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 133 B 0644
module.info.de File 126 B 0644
module.info.de.auto File 18 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 256 B 0644
module.info.es File 40 B 0644
module.info.es.auto File 120 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 163 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 179 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 139 B 0644
module.info.fr File 36 B 0644
module.info.fr.auto File 120 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 195 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 141 B 0644
module.info.hu File 45 B 0644
module.info.hu.auto File 125 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 152 B 0644
module.info.ja File 0 B 0644
module.info.ja.auto File 210 B 0644
module.info.ko File 29 B 0644
module.info.ko.auto File 127 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 164 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 147 B 0644
module.info.ms File 119 B 0644
module.info.ms.auto File 18 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 142 B 0644
module.info.nl File 25 B 0644
module.info.nl.auto File 112 B 0644
module.info.no File 25 B 0644
module.info.no.auto File 109 B 0644
module.info.pl File 115 B 0644
module.info.pl.auto File 18 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 151 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 160 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 163 B 0644
module.info.ru File 0 B 0644
module.info.ru.auto File 213 B 0644
module.info.sk File 44 B 0644
module.info.sk.auto File 130 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 143 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 137 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 241 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 162 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 226 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 218 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 169 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 129 B 0644
module.info.zh_TW File 0 B 0644
module.info.zh_TW.auto File 138 B 0644
prefs.info File 18 B 0644
save_log.cgi File 6.03 KB 0755
save_sched.cgi File 936 B 0755