From bb317d27f4d4fe0caee928582fe1cafc4947c608 Mon Sep 17 00:00:00 2001 From: Guillaume Rousse <guillaume.rousse@renater.fr> Date: Fri, 3 Nov 2017 16:31:20 +0100 Subject: [PATCH] kill useless reference to next_action --- lib/IdPAccountManager/WebRequest.pm | 35 ++++++++++++----------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/lib/IdPAccountManager/WebRequest.pm b/lib/IdPAccountManager/WebRequest.pm index 561d6ee..ed3c609 100755 --- a/lib/IdPAccountManager/WebRequest.pm +++ b/lib/IdPAccountManager/WebRequest.pm @@ -103,28 +103,21 @@ sub execute { # Check the requested action $self->{action} = $parameters{action} || 'home'; - do { - ## Actions can be chained - $self->{action} = $self->{next_action} if ($self->{next_action}); - delete $self->{next_action}; ## Prevent loops - - if (defined $self->actions->{ $self->{action} }) { - ## Execute the target subroutine named req_actionName - no strict 'refs'; - my $sub = 'req_' . $self->{action}; - $status = &{$sub}($self); - } else { - ## Inknown action - push @{ $self->{param_out}->{errors} }, "unknown_action"; - $self->{logger}->log( - level => LOG_ERROR, - message => "Unknown action '%s'", - $self->{action} - ); - - } + if (defined $self->actions->{ $self->{action} }) { + ## Execute the target subroutine named req_actionName + no strict 'refs'; + my $sub = 'req_' . $self->{action}; + $status = &{$sub}($self); + } else { + ## Inknown 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; } -- GitLab