X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FCGI%2FArchive.pm;h=758cac35ce9538dde7c6b04dbf97d141777aa5ce;hp=205111a05fcd14ac243f39d95b171943e0c2c37d;hb=8f5625f9cdf47f8e04be654c4954838b2df3e26d;hpb=2c14784ad71874ec850d189060fe63d6eb9eba95 diff --git a/lib/BackupPC/CGI/Archive.pm b/lib/BackupPC/CGI/Archive.pm index 205111a..758cac3 100644 --- a/lib/BackupPC/CGI/Archive.pm +++ b/lib/BackupPC/CGI/Archive.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 8 Feb 2004. +# Version 2.1.0beta0, released 20 Mar 2004. # # See http://backuppc.sourceforge.net. # @@ -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++ ) {