diff options
Diffstat (limited to 'lib/MGA/Mirrors/Controller/New.pm')
-rw-r--r-- | lib/MGA/Mirrors/Controller/New.pm | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/MGA/Mirrors/Controller/New.pm b/lib/MGA/Mirrors/Controller/New.pm index fbb1fbe..d3ec38c 100644 --- a/lib/MGA/Mirrors/Controller/New.pm +++ b/lib/MGA/Mirrors/Controller/New.pm @@ -44,8 +44,10 @@ sub index :Path :Args(0) { hostname => $uri->host, }); if (@{$urls || []}) { $c->stash->{exists_url} = $urls; - $c->stash->{subtemplate} = 'new/mirror_exists.tt'; - return; + if ($urls->[0]->{valid}) { + $c->stash->{subtemplate} = 'new/mirror_exists.tt'; + return; + } } if (!$c->model('Mirrors')->mirror_validity($uri)) { @@ -62,17 +64,18 @@ sub index :Path :Args(0) { my @ips = $c->model('Mirrors')->host_ips($uri->host); $c->stash->{location} = $c->model('Mirrors')->locate_ips(@ips); + $c->stash->{host}{country} = $c->stash->{location}{code}; my $mirror = $c->model('Mirrors')->find_mirrors( { hostname => $uri->host, }); if (@{ $mirror || []}) { $c->stash->{mirror} = $mirror->[0]; } elsif ($c->req->param('hostinfo')) { - foreach (qw(city country)) { + foreach (qw(city country syncfrom bandwidth)) { $c->session->{hostinfo}{$_} = $c->req->param($_); } } else { - $c->stash->{subtemplate} = 'new/host_information.tt'; + $c->stash->{subtemplate} = 'new/new_host.tt'; return; } @@ -94,6 +97,8 @@ sub confirm :Path :Args(1) { $uri->host, city => $c->session->{hostinfo}{city}, country => $c->session->{hostinfo}{country}, + bandwidth => $c->session->{hostinfo}{bandwidth}, + syncfrom => $c->session->{hostinfo}{syncfrom}, ); } else { return; |