[! use strict; use Proxmox::ConfigServer; use Proxmox::Utils; !] [- my $out = ''; my $url = $req_rec->uri; my $conn = Proxmox::ConfigClient::connect (); if ($udat{action} eq 'reboot') { if ($udat{AM} eq 'w') { $conn->restart_server ($fdat{poweroff}); } else { $udat{popup_error} = Proxmox::Utils::msg ('nowr'); } } if ($fdat{state} eq 'confirm') { if ($udat{AM} eq 'w') { my $ref = 'reboot.htm?m3=0&action=reboot'; my $msg = __("Do you really want to restart the Server?"); if ($fdat{poweroff}) { $ref .= "&poweroff=1"; $msg = __("Do you really want to shutdown the Server?"); } $out .= "
" . $msg . " " . __('yes') . " / " . __('no') . "
"; } else { $out .= "" . Proxmox::Utils::msg ('nowr') . ".
"; if ($fdat{poweroff}) { $out .= __("Server shutdown in progress."); } else { $out .= __("Server restart in progress. Please try to reconnect after the restart."); } $out .= ""; } print OUT $out; -]