diff --git a/bin/account-manager.pl.in b/bin/account-manager.pl.in index 14f712469d6599b4943096bce6ad2ff777bd6c87..050feba9a794b9155b2f0ce9786f1786cf9a1e4a 100755 --- a/bin/account-manager.pl.in +++ b/bin/account-manager.pl.in @@ -91,7 +91,8 @@ sub add_account { my $test_account = IdPAccountManager::TestAccount->new( db => $db, profile => $options{account_profile}, - sp_entityid => $options{sp_entityid} + sp_entityid => $options{sp_entityid}, + scope => $configuration->{idp_scope}, ); die "Failed to create test account\n" @@ -147,7 +148,6 @@ sub list_accounts { IdPAccountManager::Tools::update_ssp_authsources( $configuration->{templates_dir}, $configuration->{idp_accounts_file}, - $configuration->{idp_scope}, $accounts ); }; diff --git a/conf/create-manager-db.sql b/conf/create-manager-db.sql index 9ceaa290cd1f2f2c358cfa2a3cfca6a81b57637d..98fc34e3ba46124b5a23e8ade3a46d9c7044019a 100644 --- a/conf/create-manager-db.sql +++ b/conf/create-manager-db.sql @@ -33,6 +33,7 @@ CREATE TABLE `testaccounts` ( `creation_date` int(11) DEFAULT NULL, `expiration_date` int(11) DEFAULT NULL, `profile` varchar(100) NOT NULL, + `scope` varchar(100) NOT NULL, `sp_entityid` varchar(250) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/lib/IdPAccountManager/TestAccount.pm b/lib/IdPAccountManager/TestAccount.pm index 0164cfe3e23f6a9756d32908977091b4c820e278..824f14ced771717103e52f0f5864039d95e70518 100644 --- a/lib/IdPAccountManager/TestAccount.pm +++ b/lib/IdPAccountManager/TestAccount.pm @@ -16,6 +16,7 @@ __PACKAGE__->meta->setup( creation_date => { type => 'integer' }, expiration_date => { type => 'integer' }, profile => { type => 'varchar', length => 100, not_null => 1 }, + scope => { type => 'varchar', length => 100, not_null => 1 }, sp_entityid => { type => 'varchar', length => 250, not_null => 1 }, ], @@ -114,9 +115,12 @@ sub print { $fd = \*STDOUT unless $fd; printf $fd -"Account ID=%s; password_hash=%s; sp_entityid=%s; profile=%s; creation_date=%s; expiration_date=%s\n", - $self->id(), $self->password_hash(), - $self->sp_entityid(), $self->profile(), +"Account ID=%s; password_hash=%s; sp_entityid=%s; profile=%s; scope=%s; creation_date=%s; expiration_date=%s\n", + $self->id(), + $self->password_hash(), + $self->sp_entityid(), + $self->profile(), + $self->scope(), POSIX::strftime('%Y:%m:%d', localtime($self->creation_date())), POSIX::strftime('%Y:%m:%d', localtime($self->expiration_date())); } @@ -144,16 +148,6 @@ sub save { $self->SUPER::save(); } -sub scope { - my ($self, $scope) = @_; - - if ($scope) { - $self->{scope} = $scope; - } else { - return $self->{scope}; - } -} - sub internal_uid { my ($self) = @_; return 'user' . $self->id();