diff options
author | Olivier Thauvin <nanardon@mageia.org> | 2010-10-19 22:50:58 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mageia.org> | 2010-10-19 22:50:58 +0000 |
commit | 5972196ee5ac7deb2291814bd1c278ce69e4b32a (patch) | |
tree | 0e48bb471d3b7ee99b21e6ad823f8dc347b2a9e8 /lib/MGA/Mirrors/DB.pm | |
parent | 9fa18a22880f52192667c9df42d37bd75d11f1f4 (diff) | |
download | mgamirrors-5972196ee5ac7deb2291814bd1c278ce69e4b32a.tar mgamirrors-5972196ee5ac7deb2291814bd1c278ce69e4b32a.tar.gz mgamirrors-5972196ee5ac7deb2291814bd1c278ce69e4b32a.tar.bz2 mgamirrors-5972196ee5ac7deb2291814bd1c278ce69e4b32a.tar.xz mgamirrors-5972196ee5ac7deb2291814bd1c278ce69e4b32a.zip |
- ask confirm by mail on host information update to avoid spam
Diffstat (limited to 'lib/MGA/Mirrors/DB.pm')
-rw-r--r-- | lib/MGA/Mirrors/DB.pm | 6 |
1 files changed, 4 insertions, 2 deletions
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{ |