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

get rid of indirect object call syntax

parent c7881cfe
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,7 @@ if ($options{'add_test_account'}) {
die "Missing sp_entityid option";
}
my $test_account = new IdPAccountManager::TestAccount(
my $test_account = IdPAccountManager::TestAccount->new(
account_profile => $options{'account_profile'},
sp_entityid => $options{'sp_entityid'}
);
......@@ -122,7 +122,7 @@ if ($options{'add_test_account'}) {
}
} elsif ($options{'parse_federation_metadata'}) {
my $federation_metadata = new IdPAccountManager::SAMLMetadata;
my $federation_metadata = IdPAccountManager::SAMLMetadata->new();
unless (
$federation_metadata->load(
federation_metadata_file_path =>
......@@ -168,7 +168,7 @@ if ($options{'add_test_account'}) {
## Check if entry already exists in DB first
my $service_provider =
new IdPAccountManager::ServiceProvider(
IdPAccountManager::ServiceProvider->new(
entityid => $options{'sp_entityid'});
if ($service_provider->load(speculative => 1)) {
printf "Entry for %s already in DB; update it with new data\n",
......@@ -179,7 +179,7 @@ if ($options{'add_test_account'}) {
if ($options{'displayname'});
} else {
$service_provider = new IdPAccountManager::ServiceProvider(
$service_provider = IdPAccountManager::ServiceProvider->new(
entityid => $options{'sp_entityid'},
contacts => $options{'contacts'},
displayname => $options{'displayname'}
......@@ -250,7 +250,7 @@ if ($options{'add_test_account'}) {
}
my $authentication_token =
new IdPAccountManager::AuthenticationToken(%args);
IdPAccountManager::AuthenticationToken->new(%args);
unless ($authentication_token->load()) {
die "No corresponding token found in DB\n";
......@@ -281,7 +281,7 @@ if ($options{'add_test_account'}) {
die "Missing sp_entityid option";
}
my $authentication_token = new IdPAccountManager::AuthenticationToken(
my $authentication_token = IdPAccountManager::AuthenticationToken->new(
'email_address' => $options{'email_address'},
'sp_entityid' => $options{'sp_entityid'}
);
......@@ -297,7 +297,7 @@ if ($options{'add_test_account'}) {
exit -1;
}
$authentication_token = new IdPAccountManager::AuthenticationToken(
$authentication_token = IdPAccountManager::AuthenticationToken->new(
'email_address' => $options{'email_address'},
'sp_entityid' => $options{'sp_entityid'}
);
......
......@@ -74,7 +74,7 @@ sub list_service_providers {
my $service_providers;
foreach my $persistent_sp (@{$persistent_accounts}) {
my $service_provider =
new IdPAccountManager::ServiceProvider(
IdPAccountManager::ServiceProvider->new(
entityid => $persistent_sp->entityid());
$service_provider->load();
push @$service_providers, $service_provider;
......
......@@ -107,7 +107,7 @@ sub list_test_accounts {
IdPAccountManager::Data::Testaccount::Manager->get_testaccounts(%args);
my $accounts;
foreach my $persistent_account (@{$persistent_accounts}) {
my $account = new IdPAccountManager::TestAccount($persistent_account);
my $account = IdPAccountManager::TestAccount->new($persistent_account);
push @$accounts, $account;
}
......@@ -124,7 +124,7 @@ sub create_test_accounts_for_sp {
}
foreach my $profile (@{ $Conf::global{'account_profiles'} }) {
my $test_account = new IdPAccountManager::TestAccount(
my $test_account = IdPAccountManager::TestAccount->new(
account_profile => $profile,
sp_entityid => $args{'sp_entityid'}
);
......@@ -153,7 +153,7 @@ IdPAccountManager::TestAccount - Manage test user accounts for the Test Identity
=head1 SYNOPSIS
my $test_account = new IdPAccountManager::TestAccount(account_profile => 'student1',
my $test_account = IdPAccountManager::TestAccount->new(account_profile => 'student1',
sp_entityid => 'https://test.federation.renater.fr/test/ressource');
unless (defined $test_account) {
die "Failed to create test account";
......@@ -179,7 +179,7 @@ This module allows to manage the test accounts.
Class method. Create a new IdPAccountManager::TestAccount object.
Example:
my $test_account = new IdPAccountManager::TestAccount(account_profile => 'student1',
my $test_account = IdPAccountManager::TestAccount->new(account_profile => 'student1',
sp_entityid => 'https://test.federation.renater.fr/test/ressource');
Supported arguments include:
......
......@@ -23,7 +23,7 @@ sub new {
message => ''
);
my $http_query = new CGI;
my $http_query = CGI->new();
## Input parameters
my %in_vars = $http_query->Vars;
......@@ -227,7 +227,7 @@ sub req_account_wizard {
my $self = shift;
$self->{logger}->log(level => LOG_INFO, message => "");
my $federation_metadata = new IdPAccountManager::SAMLMetadata(
my $federation_metadata = IdPAccountManager::SAMLMetadata->new(
logger => $self->{logger}
);
......@@ -274,7 +274,7 @@ sub req_select_sp {
return undef;
}
my $federation_metadata = new IdPAccountManager::SAMLMetadata(
my $federation_metadata = IdPAccountManager::SAMLMetadata->new(
logger => $self->{logger}
);
......@@ -308,7 +308,7 @@ sub req_select_sp {
}
## Create a serviceprovider object to store major parameters for this SP in DB
my $service_provider = new IdPAccountManager::ServiceProvider(
my $service_provider = IdPAccountManager::ServiceProvider->new(
entityid => $self->{'param_in'}{'sp_entityid'});
## Prepare data
......@@ -347,7 +347,7 @@ sub req_select_sp {
} else {
$service_provider = new IdPAccountManager::ServiceProvider(
$service_provider = IdPAccountManager::ServiceProvider->new(
entityid => $self->{'param_in'}{'sp_entityid'},
contacts => join(',', @contacts),
displayname => $display_name
......@@ -401,7 +401,7 @@ sub req_generate_token {
}
## Create a serviceprovider object to load parameters for this SP from DB
my $service_provider = new IdPAccountManager::ServiceProvider(
my $service_provider = IdPAccountManager::ServiceProvider->new(
entityid => $self->{'param_in'}{'sp_entityid'});
# Try loading DB object first
......@@ -429,7 +429,7 @@ sub req_generate_token {
return undef;
}
my $authentication_token = new IdPAccountManager::AuthenticationToken(
my $authentication_token = IdPAccountManager::AuthenticationToken->new(
'email_address' => $self->{'param_in'}{'email_address'},
'sp_entityid' => $self->{'param_in'}{'sp_entityid'}
);
......@@ -456,7 +456,7 @@ sub req_generate_token {
return undef;
}
$authentication_token = new IdPAccountManager::AuthenticationToken(
$authentication_token = IdPAccountManager::AuthenticationToken->new(
'email_address' => $self->{'param_in'}{'email_address'},
'sp_entityid' => $self->{'param_in'}{'sp_entityid'}
);
......@@ -529,7 +529,7 @@ sub req_validate_token {
return undef;
}
my $authentication_token = new IdPAccountManager::AuthenticationToken(
my $authentication_token = IdPAccountManager::AuthenticationToken->new(
token => $self->{'param_in'}{'authentication_token'});
unless ($authentication_token->load()) {
......
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