%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
| Server IP : 14.207.165.8 / Your IP : 216.73.216.101 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/thread-self/root/usr/share/webmin/custom/ |
Upload File : |
#!/usr/bin/perl
# Save, create or delete an SQL command
require './custom-lib.pl';
&ReadParse();
$access{'edit'} || &error($text{'save_ecannot'});
if ($in{'delete'}) {
$cmd = &get_command($in{'id'}, $in{'idx'});
&delete_command($cmd);
&webmin_log("delete", "command", $cmd->{'id'}, $cmd);
&redirect("");
}
elsif ($in{'clone'}) {
&redirect("edit_sql.cgi?id=$in{'id'}&idx=$in{'idx'}&clone=1&new=1");
}
else {
&error_setup($text{'sql_err'});
if (!$in{'new'}) {
$cmd = &get_command($in{'id'}, $in{'idx'});
}
else {
$cmd = { 'id' => time() };
}
# parse and validate inputs
$cmd->{'desc'} = $in{'desc'};
$in{'order_def'} || $in{'order'} =~ /^\-?(\d+)$/ ||
&error($text{'save_eorder'});
$cmd->{'order'} = $in{'order_def'} ? 0 : int($in{'order'});
$in{'html'} =~ s/\r//g;
$in{'html'} =~ s/\n*/\n/;
$cmd->{'html'} = $in{'html'};
$cmd->{'type'} = $in{'type'};
$in{'db'} =~ /^\S+$/ || &error($text{'sql_edb'});
$cmd->{'db'} = $in{'db'};
$in{'sql'} =~ /\S/ || &error($text{'sql_esql'});
$in{'sql'} =~ s/\r//g;
$cmd->{'sql'} = $in{'sql'};
$cmd->{'user'} = $in{'dbuser'};
$cmd->{'pass'} = $in{'dbpass'};
if ($in{'host_def'}) {
delete($cmd->{'host'});
}
else {
&to_ipaddress($in{'host'}) ||
&error($text{'sql_ehost'});
$cmd->{'host'} = $in{'host'};
}
&parse_params_inputs($cmd);
&save_command($cmd);
&webmin_log($in{'new'} ? "create" : "modify", "command",
$cmd->{'id'}, $cmd);
if ($in{'new'} && $access{'cmds'} ne '*') {
$access{'cmds'} .= " ".$cmd->{'id'};
&save_module_acl(\%access);
}
&redirect("");
}