The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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

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.

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";
    }

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.

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.