#!/usr/local/cpanel/3rdparty/bin/perl # gniza cPanel Plugin — Restore Category Grid 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"; # 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 Restore'); if (!@remotes) { print qq{
No backup remotes are available for restore. Please contact your server administrator.
\n}; print GnizaCPanel::UI::page_footer(); $cpanel->end(); exit; } # Category cards my @categories = ( { type => 'account', label => 'Full Backup', desc => 'Restore entire account from backup', icon => '', }, { type => 'files', label => 'Home Directory', desc => 'Restore files and folders', icon => '', }, { type => 'database', label => 'Databases', desc => 'Restore MySQL databases', icon => '', }, { type => 'dbusers', label => 'Database Users', desc => 'Restore database users and grants', icon => '', }, { type => 'cron', label => 'Cron Jobs', desc => 'Restore scheduled tasks', icon => '', }, { type => 'domains', label => 'Domains', desc => 'Restore domain and DNS configuration', icon => '', }, { type => 'ssl', label => 'SSL Certificates', desc => 'Restore SSL certificates', icon => '', }, { type => 'mailbox', label => 'Email Accounts', desc => 'Restore mailboxes and email', icon => '', }, ); print qq{
\n}; for my $cat (@categories) { my $type = GnizaCPanel::UI::esc($cat->{type}); my $label = GnizaCPanel::UI::esc($cat->{label}); my $desc = GnizaCPanel::UI::esc($cat->{desc}); my $icon = $cat->{icon}; # Already safe SVG print qq{\n}; print qq{
\n}; print qq{
$icon
\n}; print qq{

$label

\n}; print qq{

$desc

\n}; print qq{
\n}; print qq{
\n}; } print qq{
\n}; print GnizaCPanel::UI::page_footer(); $cpanel->end();