Elive::Entity::User - Elluminate Users entity class
This class is used to query and maintain information on registered Elluminate Live! users.
my $user = Elive::Entity::User->get_by_loginName('joebloggs');
Retrieve on loginName, which is a co-key for the users table.
Please note that the Elluminate Web Services raise an error if the user was not found. So, if you're not sure if the user exists:
use Try::Tiny; my $user = try {Elive::Entity::User->get_by_loginName('joebloggs')};
my $new _user = Elive::Entity::User->insert({ loginName => ..., loginPassword => ..., firstName => ..., lastName => ..., email => ..., role => ${Elive::Entity::Role::PARTICIPANT}, )};
Insert a new user
my $user_obj = Elive::Entity::user->retrieve($user_id); $user_obj->update(role => ${Elive::Entity::Role::SYSTEM_ADMIN}); # upgrade to an app admin $user_obj->lastName('Smith'); $user_obj->update(undef, force => 1);
Update an Elluminate user. Everything can be changed, other than userId. This includes the loginName. However loginNames must all remain unique.
As a safeguard, you'll need to pass force => 1 to update: (a) users with a Role Id of 0, i.e. system administrator accounts, or (b) the login user
force => 1
Implements the changePassword SDK method.
changePassword
my $user = Elive::Entity::User->retrieve($user_id); $user->change_password($new_password);
This is equivalent to:
my $user = Elive::Entity::User->retrieve($user_id); $user->update({loginPassword => $new_password});
$user_obj->delete(); $admin_user_obj->delete(force => 1);
Delete user objects. As a safeguard, you need to pass force => 1 to delete system administrator accounts, or the login user.
Note that a deleted user, will have its deleted property immediately set, but may remain accessible for a short period of time until garbage collected.
So to check for a deleted user:
my $user = Elive::Entity::User->retrieve( $user_id ); my $user_is_deleted = !$user || $user->deleted;
Elluminate Live! can be configured to use LDAP for user management and authentication.
If LDAP is in use, the fetch and retrieve methods will continue to operate via the Elluminate SOAP command layer. User access becomes read-only. The affected methods are: insert, update, delete and change_password.
insert
update
delete
change_password
To install Elive, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Elive
CPAN shell
perl -MCPAN -e shell install Elive
For more information on module installation, please visit the detailed CPAN module installation guide.