#!/usr/local/cpanel/3rdparty/bin/perl # gniza cPanel Plugin — Step 1: Select Remote + Snapshot use strict; use warnings; BEGIN { # Find our lib directory relative to this CGI my $base; if ($0 =~ m{^(.*)/}) { $base = $1; } else { $base = '.'; } unshift @INC, "$base/lib"; } use Cpanel::LiveAPI (); use Cpanel::AdminBin::Call (); use GnizaCPanel::UI; my $cpanel = Cpanel::LiveAPI->new(); print "Content-Type: text/html\r\n\r\n"; print $cpanel->header(''); # Get allowed remotes via AdminBin my $remotes_raw = eval { Cpanel::AdminBin::Call::call('Gniza', 'Restore', 'LIST_ALLOWED_REMOTES') } // ''; my @remotes = grep { $_ ne '' } split /\n/, $remotes_raw; print GnizaCPanel::UI::page_header('GNIZA Backups'); print GnizaCPanel::UI::render_nav('index.live.cgi'); print GnizaCPanel::UI::render_flash(); if (!@remotes) { print qq{
No backup remotes are available for restore. Please contact your server administrator.
\n}; print GnizaCPanel::UI::page_footer(); print $cpanel->footer(); $cpanel->end(); exit; } print qq{
\n
\n}; print qq{

Select Backup Source

\n}; # Remote dropdown print qq{
\n}; print qq{ \n}; print qq{ \n}; print qq{
\n}; # Snapshot dropdown (populated via AJAX) print qq{
\n}; print qq{ \n}; print qq{ \n}; print qq{
\n}; print qq{
\n
\n}; print qq{
\n}; print qq{ \n}; print qq{
\n}; # JavaScript for snapshot loading and navigation print <<'END_JS'; END_JS print GnizaCPanel::UI::page_footer(); print $cpanel->footer(); $cpanel->end();