From: Eric Bollengier Date: Tue, 20 Nov 2007 20:50:29 +0000 (+0000) Subject: ebl Fix a bug in LocationLog, it works now X-Git-Tag: Release-3.0.0~2221 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bd1c8d42efb352759571fd409ff947bcb937f25a;p=bacula%2Fbacula ebl Fix a bug in LocationLog, it works now git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5964 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/bweb/ReleaseNotes b/gui/bweb/ReleaseNotes index a9b3880fc3..1e67a27d0b 100644 --- a/gui/bweb/ReleaseNotes +++ b/gui/bweb/ReleaseNotes @@ -1,4 +1,7 @@ Release Notes for bweb 2.2 +2007/11/20 + - Fix a bug in Location log feature. + 2007/11/16 - Cleanup group usage - Add some functions for security diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index 0a5fbd001b..7d221eb11d 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -2484,7 +2484,7 @@ sub location_add } my $enabled = CGI::param('enabled') || ''; - $enabled = $enabled?1:0; + $enabled = from_human_enabled($enabled); my $query = " INSERT INTO Location (Location, Cost, Enabled) @@ -2600,7 +2600,8 @@ DELETE FROM client_group_member "; $self->dbh_do($query); - $query = " + if ($arg->{jclients}) { + $query = " INSERT INTO client_group_member (clientid, client_group_id) (SELECT Clientid, (SELECT client_group_id @@ -2609,8 +2610,8 @@ DELETE FROM client_group_member FROM Client WHERE Name IN ($arg->{jclients}) ) "; - $self->dbh_do($query); - + $self->dbh_do($query); + } if ($arg->{qclient_group} ne $arg->{qnewgroup}) { $query = " UPDATE client_group @@ -3166,18 +3167,17 @@ sub location_change $comm = $self->dbh_quote("$user: $comm"); my $arg = $self->get_form('enabled'); - my $en = human_enabled($arg->{enabled}); + my $en = from_human_enabled($arg->{enabled}); my $b = $self->get_bconsole(); my $query; foreach my $vol (keys %$media) { $query = " -INSERT LocationLog (Date, Comment, MediaId, LocationId, NewVolStatus) - VALUES( - NOW(), $comm, (SELECT MediaId FROM Media WHERE VolumeName = '$vol'), - (SELECT LocationId FROM Location WHERE Location = '$media->{$vol}->{location}'), - (SELECT VolStatus FROM Media WHERE VolumeName = '$vol') - ) +INSERT INTO LocationLog (Date,Comment,MediaId,LocationId,NewEnabled,NewVolStatus) + SELECT NOW(), $comm, Media.MediaId, Location.LocationId, $en, VolStatus + FROM Media, Location + WHERE Media.VolumeName = '$vol' + AND Location.Location = '$media->{$vol}->{location}' "; $self->dbh_do($query); $self->debug($query);