X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FCGI%2FStartStopBackup.pm;h=87ff07a85f998191dfda9a76d536cad0fbb7b5b2;hp=38b7f6f1a4dbd51e2a324c465bdf4945ccbad69d;hb=refs%2Ftags%2Fv3_2_0;hpb=329e870f56fb6572fa697998d33676588034c149 diff --git a/lib/BackupPC/CGI/StartStopBackup.pm b/lib/BackupPC/CGI/StartStopBackup.pm index 38b7f6f..87ff07a 100644 --- a/lib/BackupPC/CGI/StartStopBackup.pm +++ b/lib/BackupPC/CGI/StartStopBackup.pm @@ -10,7 +10,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2003 Craig Barratt +# Copyright (C) 2003-2009 Craig Barratt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 3.2.0, released 31 Jul 2010. # # See http://backuppc.sourceforge.net. # @@ -43,10 +43,10 @@ sub action { my($str, $reply); - my $start = 1 if ( $In{action} eq $Lang->{Start_Incr_Backup} - || $In{action} eq $Lang->{Start_Full_Backup} ); - my $doFull = $In{action} eq $Lang->{Start_Full_Backup} ? 1 : 0; - my $type = $doFull ? "full" : "incremental"; + my $start = 1 if ( $In{action} eq "Start_Incr_Backup" + || $In{action} eq "Start_Full_Backup" ); + my $doFull = $In{action} eq "Start_Full_Backup" ? 1 : 0; + my $type = $doFull ? $Lang->{Type_full} : $Lang->{Type_incr}; my $host = $In{host}; my $Privileged = CheckPermission($host); @@ -70,17 +70,22 @@ sub action $reply = $bpc->ServerMesg("stop ${EscURI($host)} $User $In{backoff}"); $str = eval("qq{$Lang->{Backup_stopped_dequeued_on__host_by__User}}"); } - - Header(eval ("qq{$Lang->{BackupPC__Backup_Requested_on__host}}") ); - print (eval ("qq{$Lang->{REPLY_FROM_SERVER}}")); + my $content = eval ("qq{$Lang->{REPLY_FROM_SERVER}}"); + Header(eval ("qq{$Lang->{BackupPC__Backup_Requested_on__host}}"),$content); Trailer(); } else { if ( $start ) { - my $ipAddr = ConfirmIPAddress($host); + $bpc->ConfigRead($host); + %Conf = $bpc->Conf(); - Header(eval("qq{$Lang->{BackupPC__Start_Backup_Confirm_on__host}}")); - print (eval("qq{$Lang->{Are_you_sure_start}}")); + my $checkHost = $host; + $checkHost = $Conf{ClientNameAlias} + if ( $Conf{ClientNameAlias} ne "" ); + my $ipAddr = ConfirmIPAddress($checkHost); + my $buttonText = $Lang->{$In{action}}; + my $content = eval("qq{$Lang->{Are_you_sure_start}}"); + Header(eval("qq{$Lang->{BackupPC__Start_Backup_Confirm_on__host}}"),$content); } else { my $backoff = ""; GetStatusInfo("host(${EscURI($host)})"); @@ -88,8 +93,10 @@ sub action $backoff = sprintf("%.1f", ($StatusHost{backoffTime} - time) / 3600); } - Header($Lang->{BackupPC__Stop_Backup_Confirm_on__host}); - print (eval ("qq{$Lang->{Are_you_sure_stop}}")); + my $buttonText = $Lang->{$In{action}}; + my $content = eval ("qq{$Lang->{Are_you_sure_stop}}"); + Header(eval("qq{$Lang->{BackupPC__Stop_Backup_Confirm_on__host}}"), + $content); } Trailer(); }