Skip to content
Snippets Groups Projects
Commit 7b2e2ec4 authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

no need to store action, it is used only once

parent bb317d27
No related branches found
No related tags found
No related merge requests found
......@@ -101,20 +101,19 @@ sub execute {
}
# Check the requested action
$self->{action} = $parameters{action} || 'home';
my $action = $parameters{action} || 'home';
if (defined $self->actions->{ $self->{action} }) {
if ($self->{actions}->{$action}) {
## Execute the target subroutine named req_actionName
no strict 'refs';
my $sub = 'req_' . $self->{action};
my $sub = 'req_' . $action;
$status = &{$sub}($self);
} else {
## Inknown action
## inknown action
push @{ $self->{param_out}->{errors} }, "unknown_action";
$self->{logger}->log(
level => LOG_ERROR,
message => "Unknown action '%s'",
$self->{action}
message => "Unknown action '$action'"
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment