X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FCGI%2FArchive.pm;h=758cac35ce9538dde7c6b04dbf97d141777aa5ce;hp=864a2eafdc1783a9e21ff0e96dabeae4a0f2e9e6;hb=8f5625f9cdf47f8e04be654c4954838b2df3e26d;hpb=ce708288691ba7dd95a8dac7a468bc0e4c1d6588 diff --git a/lib/BackupPC/CGI/Archive.pm b/lib/BackupPC/CGI/Archive.pm index 864a2ea..758cac3 100644 --- a/lib/BackupPC/CGI/Archive.pm +++ b/lib/BackupPC/CGI/Archive.pm @@ -43,7 +43,11 @@ use Data::Dumper; sub action { my $archHost = $In{host}; + my $Privileged = CheckPermission(); + if ( !$Privileged ) { + ErrorExit($Lang->{Only_privileged_users_can_archive} ); + } if ( $In{type} == 0 ) { my($fullTot, $fullSizeTot, $incrTot, $incrSizeTot, $str, $strNone, $strGood, $hostCntGood, $hostCntNone, $checkBoxCnt, @@ -51,11 +55,7 @@ sub action $hostCntGood = $hostCntNone = $checkBoxCnt = $fullSizeTot = 0; GetStatusInfo("hosts"); - my $Privileged = CheckPermission(); - if ( !$Privileged ) { - ErrorExit($Lang->{Only_privileged_users_can_archive} ); - } foreach my $host ( sort(keys(%Status)) ) { my($fullDur, $incrCnt, $fullSize, $fullRate); my @Backups = $bpc->BackupInfoRead($host); @@ -98,7 +98,6 @@ EOF } else { my(@HostList, @BackupList, $HostListStr, $hiddenStr, $pathHdr, $badFileCnt, $reply, $str); - my $Privileged = CheckPermission(); my $args = { SplitPath => $bpc->{Conf}{SplitPath}, ParPath => $bpc->{Conf}{ParPath}, @@ -112,9 +111,6 @@ EOF topDir => $bpc->{TopDir}, }; - if ( !$Privileged ) { - ErrorExit($Lang->{Only_privileged_users_can_archive} ); - } ServerConnect(); for ( my $i = 0 ; $i < $In{fcbMax} ; $i++ ) {