[! use strict; use Proxmox::Utils; use Proxmox::Config::System; use Proxmox::ConfigServer; use Proxmox::HTMLTable; use Proxmox::Form; !] [- my $system_cfg = $fdat{__system_config}; my $out = ""; my $url = $req_rec->uri; my $lic = $system_cfg->{kavlicense}; if (!$lic->valid) { $out .= "

" . __("You do not have a valid Kaspersky license.") . "

"; } else { my $conn = Proxmox::ConfigClient::connect (); if ($fdat{action} eq 'update') { if ($udat{AM} eq 'w') { $udat{update_log} = $conn->kav_keepup2date ()->result; } else { $udat{popup_error} = Proxmox::Utils::msg ('nowr'); } } my $frm = Proxmox::Form->new (\%fdat); my $lupdate = $conn->kav_dbinfo()->result; $frm->add_element("lupdate", "rotext", $lupdate, "Database Timestamp"); $frm->add_cfg_element('kav', 'region', "dropdown", "", "Database Mirror", ['Russia', 'Europe', 'America', 'China', 'Japan', 'Korea'] ); if ($udat{update_log} && !$fdat{action}) { $frm->add_element("update_log", "textarea", $udat{update_log}, __("Update Log")); delete $udat{update_log}; } $frm->add_element(__("Update now"), "link", "$url?action=update", ""); $frm->add_element("m3", "hidden"); if ($frm->submit==0) { $frm->load_cfg ($system_cfg); } else { if ($udat{AM} eq 'w') { $frm->save_cfg ($system_cfg); $conn->rewrite_config_kav (); } else { $udat{popup_error} = Proxmox::Utils::msg ('nowr'); } } $out .= $frm->out_form; } print OUT $out; -]