Nitesi::Account::Manager - Account Manager for Nitesi Shop Machine
$acct = Nitesi::Account::Manager->instance(provider_sub => \&account_providers, session_sub => \&session); $acct->init_from_session; $acct->status(login_info => 'Please login before checkout', login_continue => 'checkout'); $acct->login(username => 'shopper@nitesi.biz', password => 'nevairbe'); $acct->logout(); if ($acct->exists('shopper@nitesi.biz')) { $acct->password(username => 'shopper@nitesi.biz', password => 'nevairbe'); } $acct->create(email => 'shopper@nitesi.biz'); # use this with caution! $acct->become('shopper@nitesi.biz');
Nitesi's account manager transparently handles multiple providers for authentication, account data and permissions checks.
Initializer called by instance class method.
Reads user information through session routine.
Perform login.
Leading and trailing spaces will be removed from username and password in advance.
Perform logout.
Create account.
Delete account.
Retrieve user identifier, returns 0 if current user isn't authenticated.
Retrieve username. Returns empty string if current user isn't authenticated.
Retrieve roles of this user.
Returns true if user is a member of the given role.
Saves or retrieves status information.
Check whether account exists.
if ($acct->exists('shopper@nitesi.biz')) { print "Account exists\n"; }
Loads account data for a given uid.
Changes password for current account:
$acct->password('nevairbe');
Changes password for other account:
$acct->password(username => 'shopper@nitesi.biz', password => 'nevairbe');
ACL check, see ACL::Lite for details.
Retrieve account data.
Become an user:
$acct->become('shopper@nitesi.biz');
Please use this method with caution.
Providers may choose not to support this method.
Stefan Hornburg (Racke), <racke@linuxia.de>
Copyright 2011-2012 Stefan Hornburg (Racke) <racke@linuxia.de>.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Nitesi, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Nitesi
CPAN shell
perl -MCPAN -e shell install Nitesi
For more information on module installation, please visit the detailed CPAN module installation guide.