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

retrieve accounts list in the caller

parent 2418a31a
No related branches found
No related tags found
No related merge requests found
......@@ -137,10 +137,16 @@ sub list_accounts {
}
printf "%d accounts removed\n", scalar @$accounts;
$accounts =
IdPAccountManager::Data::TestAccount::Manager->get_testaccounts(
db => $db
);
die "failed to update simpleSAMLphp configuration file\n"
unless IdPAccountManager::Tools::update_ssp_authsources(
$configuration->{templates_dir},
$configuration->{idp_accounts_file}}
$configuration->{idp_accounts_file},
$accounts
);
printf "Update simpleSamlPhp configuration file...\n";
......
......@@ -8,8 +8,6 @@ use Encode;
use Template;
use Template::Stash;
use IdPAccountManager::Data::TestAccount::Manager;
INIT {
## a TT2 virtual method to get a variable type
$Template::Stash::LIST_OPS->{isa} = sub {
......@@ -82,14 +80,14 @@ sub generate_password {
## Updates simpleSamlPhp authsources.php configuration file
sub update_ssp_authsources {
my ($templates_dir, $output) = @_;
my ($templates_dir, $output, $accounts) = @_;
my $tt2 = Template->new({
INCLUDE_PATH => $templates_dir
});
my $template = 'accountProfiles/valid-accounts.php.tt2';
my $data = {
accounts => IdPAccountManager::Data::TestAccount::Manager->get_testaccounts(),
accounts => $accounts
};
return $tt2->process($template, $data, $output);
......
......@@ -488,6 +488,7 @@ sub req_validate_token {
unless (IdPAccountManager::Tools::update_ssp_authsources(
$self->{configuration}->{templates_dir},
$self->{configuration}->{idp_accounts_file},
\@accounts
)) {
push @{ $self->{out}->{errors} }, "accounts_creation_failed";
$self->{logger}->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