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

enforce strict and warnings pragmas

parent 0bb6452e
No related branches found
No related tags found
No related merge requests found
package IdPAccountManager::WebRequest;
use strict;
use warnings;
use IdPAccountManager::Logger;
## New web request
sub new {
my $pkg = shift;
my $request = {};
my %args = shift;
my $request = {
format => $args{format},
actions => $args{actions},
};
$request->{logger} = IdPAccountManager::Logger->new(
file => $Conf::global{'log_file'},
......@@ -33,7 +40,7 @@ sub new {
## Usefull data for output (web pages or mail notices)
$request->{'param_out'}{'url_cgi'} = $ENV{'SCRIPT_NAME'};
$request->{'param_out'}{'env'} = \%ENV;
$request->{'param_out'}{'actions'} = \%actions;
$request->{'param_out'}{'actions'} = $args{actions};
$request->{'param_out'}{'conf'} = \%Conf::global;
## Dumping input data
......@@ -87,10 +94,10 @@ sub execute {
## Check input parameters format
foreach my $key (keys %{ $self->{'param_in'} }) {
if ( $self->{'param_in'}{$key} !~ /^\s*$/
&& defined $format{$key}
&& !ref($format{$key}))
&& defined $self->{format}->{$key}
&& !ref($self->{format}->{$key}))
{
unless ($self->{'param_in'}{$key} =~ /^$format{$key}$/) {
unless ($self->{'param_in'}{$key} =~ /^$self->format->{$key}$/) {
push @{ $self->{'param_out'}{'errors'} }, "format_$key";
$self->{logger}->log(
level => LOG_ERROR,
......@@ -106,7 +113,7 @@ sub execute {
$self->{'action'} = $self->{'next_action'} if ($self->{'next_action'});
delete $self->{'next_action'}; ## Prevent loops
if (defined $actions{ $self->{'action'} }) {
if (defined $self->actions->{ $self->{'action'} }) {
## Execute the target subroutine named req_actionName
no strict 'refs';
my $sub = 'req_' . $self->{'action'};
......@@ -576,7 +583,7 @@ sub req_validate_token {
}
## Update simpleSAMLphp configuration to enable test accounts
unless (IdPAccountManager::Tools::update_ssp_authsources() {
unless (IdPAccountManager::Tools::update_ssp_authsources()) {
push @{ $self->{'param_out'}{'errors'} }, "accounts_creation_failed";
$self->{logger}->log(
level => LOG_ERROR,
......
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