From 5972196ee5ac7deb2291814bd1c278ce69e4b32a Mon Sep 17 00:00:00 2001 From: Olivier Thauvin Date: Tue, 19 Oct 2010 22:50:58 +0000 Subject: - ask confirm by mail on host information update to avoid spam --- lib/MGA/Mirrors/DB.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/MGA/Mirrors/DB.pm') diff --git a/lib/MGA/Mirrors/DB.pm b/lib/MGA/Mirrors/DB.pm index 16070dc..a7655b8 100644 --- a/lib/MGA/Mirrors/DB.pm +++ b/lib/MGA/Mirrors/DB.pm @@ -468,8 +468,10 @@ sub apply_change_request { delete $res->{reqid}; $self->add_or_update_host($hostname, %{$res}); + my $del = $self->db->prepare(q{delete from hosts_ch_req where reqid = ?}); + $del->execute($reqid); $self->db->commit; - 1 + $hostname } sub add_or_update_host { @@ -478,7 +480,7 @@ sub add_or_update_host { my (@fields, @vals); while (my ($field, $val) = each(%info)) { push(@fields, $field); - push(@vals, $val || undef); + push(@vals, (defined($val) && $val ne '' ? $val : undef)); } if (keys %info) { my $upd = $self->db->prepare(sprintf(q{ -- cgit v1.2.1