The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Nitesi::Account::Manager - Account Manager for Nitesi Shop Machine

SYNOPSIS

    $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');

METHODS

init

Initializer called by instance class method.

init_from_session

Reads user information through session routine.

login

Perform login.

Leading and trailing spaces will be removed from username and password in advance.

logout

Perform logout.

create

Create account.

delete

Delete account.

uid

Retrieve user identifier, returns 0 if current user isn't authenticated.

username

Retrieve username. Returns empty string if current user isn't authenticated.

roles

Retrieve roles of this user.

has_role

Returns true if user is a member of the given role.

status

Saves or retrieves status information.

exists

Check whether account exists.

    if ($acct->exists('shopper@nitesi.biz')) {
        print "Account exists\n";
    }

load

Loads account data for a given uid.

password

Changes password for current account:

    $acct->password('nevairbe');

Changes password for other account:

    $acct->password(username => 'shopper@nitesi.biz',
                    password => 'nevairbe');

acl

ACL check, see ACL::Lite for details.

value

Retrieve account data.

become

Become an user:

    $acct->become('shopper@nitesi.biz');

Please use this method with caution.

Providers may choose not to support this method.

AUTHOR

Stefan Hornburg (Racke), <racke@linuxia.de>

LICENSE AND COPYRIGHT

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.