BackupPC_Admin (BackupPC-4.3.2) | : | BackupPC_Admin (BackupPC-4.4.0) | ||
---|---|---|---|---|
skipping to change at line 41 | skipping to change at line 41 | |||
# This program is distributed in the hope that it will be useful, | # This program is distributed in the hope that it will be useful, | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
# GNU General Public License for more details. | # GNU General Public License for more details. | |||
# | # | |||
# You should have received a copy of the GNU General Public License | # You should have received a copy of the GNU General Public License | |||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
# | # | |||
#======================================================================== | #======================================================================== | |||
# | # | |||
# Version 4.3.2, released 17 Feb 2020. | # Version 4.4.0, released 20 Jun 2020. | |||
# | # | |||
# See http://backuppc.sourceforge.net. | # See http://backuppc.sourceforge.net. | |||
# | # | |||
#======================================================================== | #======================================================================== | |||
use strict; | use strict; | |||
no utf8; | no utf8; | |||
use CGI; | use CGI; | |||
use CGI::Carp qw(fatalsToBrowser); | use CGI::Carp qw(fatalsToBrowser); | |||
use lib "__INSTALLDIR__/lib"; | use lib "__INSTALLDIR__/lib"; | |||
use BackupPC::Lib; | use BackupPC::Lib; | |||
use BackupPC::CGI::Lib qw(:all); | use BackupPC::CGI::Lib qw(:all); | |||
BackupPC::CGI::Lib::NewRequest; | BackupPC::CGI::Lib::NewRequest; | |||
my %ActionDispatch = ( | my %ActionDispatch = ( | |||
"deleteBackup" => "DeleteBackup", | "summary" => "Summary", | |||
"summary" => "Summary", | "Start_Incr_Backup" => "StartStopBackup", | |||
"Start_Incr_Backup" => "StartStopBackup", | "Start_Full_Backup" => "StartStopBackup", | |||
"Start_Full_Backup" => "StartStopBackup", | "Stop_Dequeue_Backup" => "StartStopBackup", | |||
"Stop_Dequeue_Backup" => "StartStopBackup", | "Stop_Dequeue_Archive" => "StartStopBackup", | |||
"Stop_Dequeue_Archive" => "StartStopBackup", | "queue" => "Queue", | |||
"queue" => "Queue", | "view" => "View", | |||
"view" => "View", | "LOGlist" => "LOGlist", | |||
"LOGlist" => "LOGlist", | "emailSummary" => "EmailSummary", | |||
"emailSummary" => "EmailSummary", | "browse" => "Browse", | |||
"browse" => "Browse", | "dirHistory" => "DirHistory", | |||
"dirHistory" => "DirHistory", | "Restore" => "Restore", | |||
"Restore" => "Restore", | "RestoreFile" => "RestoreFile", | |||
"RestoreFile" => "RestoreFile", | "hostInfo" => "HostInfo", | |||
"hostInfo" => "HostInfo", | "generalInfo" => "GeneralInfo", | |||
"generalInfo" => "GeneralInfo", | "restoreInfo" => "RestoreInfo", | |||
"restoreInfo" => "RestoreInfo", | "archiveInfo" => "ArchiveInfo", | |||
"archiveInfo" => "ArchiveInfo", | "Start_Archive" => "Archive", | |||
"Start_Archive" => "Archive", | "Archive" => "Archive", | |||
"Archive" => "Archive", | "Reload" => "ReloadServer", | |||
"Reload" => "ReloadServer", | "startServer" => "StartServer", | |||
"startServer" => "StartServer", | "Stop" => "StopServer", | |||
"Stop" => "StopServer", | "adminOpts" => "AdminOptions", | |||
"adminOpts" => "AdminOptions", | "editConfig" => "EditConfig", | |||
"editConfig" => "EditConfig", | "deleteBackup" => "DeleteBackup", | |||
"rss" => "RSS", | "keepBackup" => "HostInfo", | |||
"rss" => "Metrics", | ||||
"metrics" => "Metrics", | ||||
); | ); | |||
# | # | |||
# Set default actions, then call sub handler | # Set default actions, then call sub handler | |||
# | # | |||
if ( !defined($ActionDispatch{$In{action}}) ) { | if ( !defined($ActionDispatch{$In{action}}) ) { | |||
$In{action} = defined($In{host}) ? "hostInfo" : "generalInfo"; | $In{action} = defined($In{host}) ? "hostInfo" : "generalInfo"; | |||
} | } | |||
my $action = $ActionDispatch{$In{action}}; | my $action = $ActionDispatch{$In{action}}; | |||
skipping to change at line 108 | skipping to change at line 111 | |||
# the directory onto INC if it is missing. This is an ugly hack; | # the directory onto INC if it is missing. This is an ugly hack; | |||
# need to figure out what's really going on... | # need to figure out what's really going on... | |||
# | # | |||
my $installDir = '__INSTALLDIR__/lib'; | my $installDir = '__INSTALLDIR__/lib'; | |||
push(@INC, $installDir) if ( !grep($_ eq $installDir, @INC) ); | push(@INC, $installDir) if ( !grep($_ eq $installDir, @INC) ); | |||
# | # | |||
# Load the relevant action script and run it | # Load the relevant action script and run it | |||
# | # | |||
require "BackupPC/CGI/$action.pm" | require "BackupPC/CGI/$action.pm" | |||
if ( !defined($BackupPC::CGI::{"${action}::"}) ); | if ( !defined($BackupPC::CGI::{"${action}::"}) ); | |||
$BackupPC::CGI::{"${action}::"}{action}(); | $BackupPC::CGI::{"${action}::"}{action}(); | |||
End of changes. 4 change blocks. | ||||
29 lines changed or deleted | 32 lines changed or added |