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

rename ServiceProvider class to Entity

parent 5a13a125
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ use Pod::Usage;
use AccountManager::DB;
use AccountManager::Metadata;
use AccountManager::ServiceProvider;
use AccountManager::Entity;
my %options;
GetOptions(
......@@ -48,7 +48,7 @@ my $ua = LWP::UserAgent->new();
$db->begin_work();
AccountManager::ServiceProvider->delete_service_providers(all => 1);
AccountManager::Entity->delete_entities(all => 1);
my %seen;
foreach my $id (split(/, */, $configuration->{groups}->{list})) {
......@@ -89,7 +89,7 @@ foreach my $id (split(/, */, $configuration->{groups}->{list})) {
# avoid duplicates
next if $seen{$entry->{entityid}}++;
my $entity = AccountManager::ServiceProvider->new(
my $entity = AccountManager::Entity->new(
db => $db,
entityid => $entry->{entityid},
displayname => $entry->{display_name},
......
......@@ -11,7 +11,7 @@ CREATE TABLE tokens (
CONSTRAINT token_email_entity UNIQUE (email_address(50),sp_entityid(50))
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE services (
CREATE TABLE entities (
id bigint(20) NOT NULL AUTO_INCREMENT,
entityid varchar(200) NOT NULL,
url varchar(200) DEFAULT NULL,
......
......@@ -15,7 +15,7 @@ use UNIVERSAL::require;
use AccountManager::Account;
use AccountManager::Metadata;
use AccountManager::ServiceProvider;
use AccountManager::Entity;
use AccountManager::Token;
use AccountManager::Tools;
use AccountManager::L10N;
......@@ -346,7 +346,7 @@ sub req_select_email {
my $federation = $self->get_parameter(name => 'federation');
# Create a persistent service provider object
my $sp = AccountManager::ServiceProvider->new(
my $sp = AccountManager::Entity->new(
db => $self->{db},
entityid => $entityid
);
......@@ -423,7 +423,7 @@ sub req_complete_challenge {
my $entityid = $self->get_parameter(name => 'entityid');
my $email = $self->get_parameter(name => 'email');
my $sp = AccountManager::ServiceProvider->new(
my $sp = AccountManager::Entity->new(
db => $self->{db},
entityid => $entityid,
);
......@@ -612,7 +612,7 @@ sub req_create_accounts {
$self->check_token(token => $token, entityid => $entityid);
my $sp = AccountManager::ServiceProvider->new(
my $sp = AccountManager::Entity->new(
db => $self->{db},
entityid => $entityid,
);
......
package AccountManager::ServiceProvider;
package AccountManager::Entity;
use strict;
use warnings;
......@@ -9,7 +9,7 @@ use List::MoreUtils qw(any);
use Rose::DB::Object::Manager;
__PACKAGE__->meta->setup(
table => 'services',
table => 'entities',
columns => [
id => { type => 'bigserial', not_null => 1 },
......@@ -24,14 +24,14 @@ __PACKAGE__->meta->setup(
unique_key => [ 'entityid' ],
);
Rose::DB::Object::Manager->make_manager_methods('service_providers');
Rose::DB::Object::Manager->make_manager_methods('entities');
sub print {
my ($self, $fd) = @_;
$fd = \*STDOUT unless $fd;
printf $fd
"Service ID=%s; entityid=%s; displayname=%s; contacts=%s\n",
"Entity ID=%s; entityid=%s; displayname=%s; contacts=%s\n",
$self->id(),
$self->entityid(),
$self->displayname() || '',
......
......@@ -5,7 +5,7 @@ nobase_modules_DATA = \
AccountManager/DB.pm \
AccountManager/DB/Object.pm \
AccountManager/Metadata.pm \
AccountManager/ServiceProvider.pm \
AccountManager/Entity.pm \
AccountManager/Account.pm \
AccountManager/Tools.pm \
AccountManager/L10N.pm \
......
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