aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MGA/Mirrors/Controller/Validate.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MGA/Mirrors/Controller/Validate.pm')
-rw-r--r--lib/MGA/Mirrors/Controller/Validate.pm54
1 files changed, 54 insertions, 0 deletions
diff --git a/lib/MGA/Mirrors/Controller/Validate.pm b/lib/MGA/Mirrors/Controller/Validate.pm
new file mode 100644
index 0000000..61d18f5
--- /dev/null
+++ b/lib/MGA/Mirrors/Controller/Validate.pm
@@ -0,0 +1,54 @@
+package MGA::Mirrors::Controller::Validate;
+use Moose;
+use namespace::autoclean;
+
+BEGIN {extends 'Catalyst::Controller'; }
+
+=head1 NAME
+
+MGA::Mirrors::Controller::Validate - Catalyst Controller
+
+=head1 DESCRIPTION
+
+Catalyst Controller.
+
+=head1 METHODS
+
+=cut
+
+
+=head2 index
+
+=cut
+
+sub index :Path :Args(0) {
+ my ( $self, $c ) = @_;
+
+ $c->response->body('Matched MGA::Mirrors::Controller::Validate in Validate.');
+}
+
+
+sub validate :Path :Args(1) {
+ my ( $self, $c, $reqid ) = @_;
+
+ if (my $hostname = $c->model('Mirrors')->apply_change_request($reqid)) {
+ $c->stash->{hostname} = $hostname;
+ } else {
+ $c->stash->{template} = 'validate/error.tt';
+ }
+}
+
+=head1 AUTHOR
+
+Olivier Thauvin
+
+=head1 LICENSE
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+__PACKAGE__->meta->make_immutable;
+
+1;