"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/BackupPC/CGI/StartStopBackup.pm" between
BackupPC-4.3.2.tar.gz and BackupPC-4.4.0.tar.gz

About: BackupPC is a high-performance, enterprise-grade system for backing up Linux and WinXX PCs and laptops to a server’s disk (http/cgi user interface).

StartStopBackup.pm  (BackupPC-4.3.2):StartStopBackup.pm  (BackupPC-4.4.0)
skipping to change at line 30 skipping to change at line 30
# 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.
# #
#======================================================================== #========================================================================
package BackupPC::CGI::StartStopBackup; package BackupPC::CGI::StartStopBackup;
use strict; use strict;
use BackupPC::CGI::Lib qw(:all); use BackupPC::CGI::Lib qw(:all);
sub action sub action
{ {
my($str, $reply); my($str, $reply);
my $start = 1 if ( $In{action} eq "Start_Incr_Backup" my $start = 1 if ( $In{action} eq "Start_Incr_Backup" || $In{action} eq
|| $In{action} eq "Start_Full_Backup" ); "Start_Full_Backup" );
my $doFull = $In{action} eq "Start_Full_Backup" ? 1 : 0; my $doFull = $In{action} eq "Start_Full_Backup" ? 1 : 0;
my $type = $doFull ? $Lang->{Type_full} : $Lang->{Type_incr}; my $type = $doFull ? $Lang->{Type_full} : $Lang->{Type_incr};
my $host = $In{host}; my $host = $In{host};
my $Privileged = CheckPermission($host); my $Privileged = CheckPermission($host);
if ( !$Privileged ) { if ( !$Privileged ) {
ErrorExit(eval("qq{$Lang->{Only_privileged_users_can_stop_or_start_backu ps}}")); ErrorExit(eval("qq{$Lang->{Only_privileged_users_can_stop_or_start_backu ps}}"));
} }
ServerConnect(); ServerConnect();
if ( $In{doit} ) { if ( $In{doit} ) {
if ( $start ) { if ( $start ) {
if ( $Hosts->{$host}{dhcp} ) { if ( $Hosts->{$host}{dhcp} ) {
$reply = $bpc->ServerMesg("backup $In{hostIP} ${EscURI($host)}" $reply = $bpc->ServerMesg("backup $In{hostIP} ${EscURI($host)} $
. " $User $doFull"); User $doFull");
$str = eval("qq{$Lang->{Backup_requested_on_DHCP__host}}"); $str = eval("qq{$Lang->{Backup_requested_on_DHCP__host}}");
} else { } else {
$reply = $bpc->ServerMesg("backup ${EscURI($host)}" $reply = $bpc->ServerMesg("backup ${EscURI($host)} ${EscURI($hos
. " ${EscURI($host)} $User $doFull"); t)} $User $doFull");
$str = eval("qq{$Lang->{Backup_requested_on__host_by__User}}"); $str = eval("qq{$Lang->{Backup_requested_on__host_by__User}}")
} ;
}
} else { } else {
$reply = $bpc->ServerMesg("stop ${EscURI($host)} $User $In{backoff}" ); $reply = $bpc->ServerMesg("stop ${EscURI($host)} $User $In{backoff}" );
$str = eval("qq{$Lang->{Backup_stopped_dequeued_on__host_by__User}}" ); $str = eval("qq{$Lang->{Backup_stopped_dequeued_on__host_by__User} }");
} }
my $content = eval ("qq{$Lang->{REPLY_FROM_SERVER}}"); my $content = eval("qq{$Lang->{REPLY_FROM_SERVER}}");
Header(eval ("qq{$Lang->{BackupPC__Backup_Requested_on__host}}"),$conten Header(eval("qq{$Lang->{BackupPC__Backup_Requested_on__host}}"), $conten
t); t);
Trailer(); Trailer();
} else { } else {
if ( $start ) { if ( $start ) {
$bpc->ConfigRead($host); $bpc->ConfigRead($host);
%Conf = $bpc->Conf(); %Conf = $bpc->Conf();
my $checkHost = $host; my $checkHost = $host;
$checkHost = $Conf{ClientNameAlias} $checkHost = $Conf{ClientNameAlias}
if ( $Conf{ClientNameAlias} ne "" ); if ( $Conf{ClientNameAlias} ne "" );
my $ipAddr = ConfirmIPAddress($checkHost); my $ipAddr = ConfirmIPAddress($checkHost);
my $buttonText = $Lang->{$In{action}}; my $buttonText = $Lang->{$In{action}};
my $content = eval("qq{$Lang->{Are_you_sure_start}}"); my $content = eval("qq{$Lang->{Are_you_sure_start}}");
Header(eval("qq{$Lang->{BackupPC__Start_Backup_Confirm_on__host}}"), Header(eval("qq{$Lang->{BackupPC__Start_Backup_Confirm_on__host}}"),
$content); $content);
} else { } else {
my $backoff = ""; my $backoff = "";
GetStatusInfo("host(${EscURI($host)})"); GetStatusInfo("host(${EscURI($host)})");
if ( $StatusHost{backoffTime} > time ) { if ( $StatusHost{backoffTime} > time ) {
$backoff = sprintf("%.1f", $backoff = sprintf("%.1f", ($StatusHost{backoffTime} - time) / 3
($StatusHost{backoffTime} - time) / 3600); 600);
} }
my $buttonText = $Lang->{$In{action}}; my $buttonText = $Lang->{$In{action}};
my $content = eval ("qq{$Lang->{Are_you_sure_stop}}"); my $content = eval("qq{$Lang->{Are_you_sure_stop}}");
Header(eval("qq{$Lang->{BackupPC__Stop_Backup_Confirm_on__host}}"), Header(eval("qq{$Lang->{BackupPC__Stop_Backup_Confirm_on__host}}"),
$content); $content);
} }
Trailer(); Trailer();
} }
} }
1; 1;
 End of changes. 9 change blocks. 
29 lines changed or deleted 30 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)