Text::Tradition::User - Users which own traditions, and can login to the web app
## Users are managed by Text::Tradition::Directory my $userstore = Text::Tradition::Directory->new(dsn => 'dbi:SQLite:foo.db'); my $newuser = $userstore->add_user({ username => 'fred', password => 'somepassword' }); my $fetchuser = $userstore->find_user({ username => 'fred' }); if($fetchuser->check_password('somepassword')) { ## login user or .. whatever } my $user = $userstore->deactivate_user({ username => 'fred' }); if(!$user->active) { ## shouldnt be able to login etc } foreach my $t (@{ $user->traditions }) { ## do something with traditions owned by this user. }
User objects representing owners of Text::Traditions and authenticated users.
Inherited from KiokuX::User, stores the 'username' (login) of the user.
User's password, encrypted on creation (by "crypt_password" in KiokuX::User::Util.
Active flag, defaults to true (1). Will be set to false (0) by "deactivate_user" in Text::Tradition::UserStore.
Returns an ArrayRef of Text::Tradition objects belonging to this user.
Inherited from KiokuX::User, verifies a given password string against the stored encrypted version.
Assigns the given tradition to this user.
Removes the specified tradition from the control of this user.
Returns true if this user has administrative privileges.
To install Text::Tradition::Directory, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Tradition::Directory
CPAN shell
perl -MCPAN -e shell install Text::Tradition::Directory
For more information on module installation, please visit the detailed CPAN module installation guide.