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/Controller/Mirrors.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/Controller/Mirrors.pm')
-rw-r--r-- | lib/MGA/Mirrors/Controller/Mirrors.pm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/MGA/Mirrors/Controller/Mirrors.pm b/lib/MGA/Mirrors/Controller/Mirrors.pm index 73fa5ae..aa22848 100644 --- a/lib/MGA/Mirrors/Controller/Mirrors.pm +++ b/lib/MGA/Mirrors/Controller/Mirrors.pm @@ -31,12 +31,12 @@ sub mirror :Path :Args(1) { my ( $self, $c, $host ) = @_; $c->stash->{hostname} = $host; - if ($c->req->param('hostinfo')) { + if ($c->req->param('hostinfo') && $c->req->param('mail')) { my $hinfo = $c->model('Mirrors')->find_mirrors({ hostname => $host, })->[0]; if (! $hinfo->{readonly}) { - $c->model('Mirrors')->add_or_update_host($host, + my $reqid = $c->model('Mirrors')->add_host_change_request($host, bandwidth => $c->req->param('bandwidth'), city => $c->req->param('city'), country => $c->req->param('country'), @@ -44,6 +44,16 @@ sub mirror :Path :Args(1) { latitude => $c->req->param('latitude'), longitude => $c->req->param('longitude'), ); + $c->forward( + q'MGA::Mirrors::View::Mail', 'render', + [ 'host_up_request.tt', { + To => $c->req->param('mail'), + Subject => 'Update Mageia mirror request', + mail => { + reqid => $reqid, + } + } ] + ); } } |