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

kill useless reference to next_action

parent 42e88f2e
No related branches found
No related tags found
No related merge requests found
...@@ -103,28 +103,21 @@ sub execute { ...@@ -103,28 +103,21 @@ sub execute {
# Check the requested action # Check the requested action
$self->{action} = $parameters{action} || 'home'; $self->{action} = $parameters{action} || 'home';
do { if (defined $self->actions->{ $self->{action} }) {
## Actions can be chained ## Execute the target subroutine named req_actionName
$self->{action} = $self->{next_action} if ($self->{next_action}); no strict 'refs';
delete $self->{next_action}; ## Prevent loops my $sub = 'req_' . $self->{action};
$status = &{$sub}($self);
if (defined $self->actions->{ $self->{action} }) { } else {
## Execute the target subroutine named req_actionName ## Inknown action
no strict 'refs'; push @{ $self->{param_out}->{errors} }, "unknown_action";
my $sub = 'req_' . $self->{action}; $self->{logger}->log(
$status = &{$sub}($self); level => LOG_ERROR,
} else { message => "Unknown action '%s'",
## Inknown action $self->{action}
push @{ $self->{param_out}->{errors} }, "unknown_action"; );
$self->{logger}->log(
level => LOG_ERROR,
message => "Unknown action '%s'",
$self->{action}
);
}
} while ($self->{next_action}); }
return 1; return 1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment