diff options
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, + } + } ] + ); } } |