r164@klaxLaptop: klax | 2005-10-07 14:05:39 +0200
authoriklaric <iklaric@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Fri, 7 Oct 2005 12:06:35 +0000 (12:06 +0000)
committeriklaric <iklaric@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Fri, 7 Oct 2005 12:06:35 +0000 (12:06 +0000)
 - minor bugfix ( archive creation )

git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@148 8392b6e1-25fa-0310-8288-cc32f8e212ea

lib/BackupPC/CGI/BurnMedia.pm

index 3920feb..0cdfcf7 100644 (file)
@@ -47,31 +47,31 @@ EOF
                        }
                }
 
-               # create new archive
-               my $sth = $dbh->prepare(q{
-                               INSERT INTO archive (
-                                       id,
-                                       dvd_nr,
-                                       note,
-                                       username,
-                                       date
-                               ) VALUES (
-                                       nextVal('archive_id_seq'),
-                                       nextVal('dvd_nr'),
-                                       ?,
-                                       ?,
-                                       NOW()
-                               )
-               });
-
-               # FIXME insert user here
-               $sth->execute($In{'note'}, 'dummy_user');
 
                if ($total_size > $Conf{MaxArchiveSize}) {
                        $cont .= eval( q{ ${h2(Error)}});
                        $cont .= "Selected backups exceed max archive size.";
                } else {
 
+                       # create new archive
+                       my $sth = $dbh->prepare(q{
+                                                       INSERT INTO archive (
+                                                               id,
+                                                               dvd_nr,
+                                                               note,
+                                                               username,
+                                                               date
+                                                       ) VALUES (
+                                                               nextVal('archive_id_seq'),
+                                                               nextVal('dvd_nr'),
+                                                               ?,
+                                                               ?,
+                                                               NOW()
+                                                       )
+                                               });
+
+                       # FIXME insert user here
+                       $sth->execute($In{'note'}, 'dummy_user');
 
                        foreach my $backup_id (@selected_backup_ids) {