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

Aut::UI::Console - Reference implementation for a User Interface to Aut

ABSTRACT

This is a very simple Console based reference implementation for a User Interface to the Aut Framework.

DESCRIPTION

Aut::UI:... classes are user interface classes to Aut. They are called through the Aut module. Most methods that have to be implemented, when called through an Aut object are given this same object as an argument, to make it possible to call back into the Aut object.

Note!

  • The user interface must take care that the last admin account is not deleted. This user interface does this by not removing the account currently in use.

  • The admin() function can always be called. The calling program must take care that the function is not allowed for non adminlevel accounts.

Instantiating and initializing

new() --> Aut::UI::Console

    This method instantiates a new Aut::UI::Console object.

initialize(level::\(list authorization_level:string, admin_level:string) --> void

    This method is called from an Aut object to initialize the user interface with a list of possible authorization levels and the level that has administrator rights.

message(msg:string) --> void

    This function displays message 'msg' for this UI. Usually called to display some log message or information message about work in progress.

message_ok(msg:string) --> void

    This function displays message 'msg' and waits for input (OK button, Enter, whatever is standard for the given UI environment).

ask_pass(aut:Aut, msg:string [,any]) --> string

    This function displays message 'msg', displays a appropriate prompt and asks the user to input his/hers password.

    Returns the password that has been entered.

login(aut:Aut [,any]) --> Aut::Ticket

    This function askes account and password and returns a ticket for the given account. The ticket can be retreived from the Aut object, using the aut->ticket_get function.

logout(aut:Aut, ticket:Aut::Ticket, [,any]) --> boolean

    This function can be used to inform the user about logging out and check certain properties before logging out (e.g. if the user confirms logging out). It returns true, if the user can logout, false otherwise.

change_pass(aut:Aut, ticket:Aut::Ticket, [,any] --> void

    This function is used to enable changing a password for a given ticket. The function must ask the password two times, validate their equalness, validate the password through aut->check_pass() and if valid, store the new password in the ticket using ticket->set_pass(pass) and update the ticket in the backend using aut->ticket_update(ticket).

Administration

admin(aut:Aut, ticket, [,any]) --> void

    This function is used to do account administration. It takes the aut system as argument and the ticket of the administrator that is going to do administration. It must provide following functionality:

    1. Adding new accounts.

    2. Changing the password for an account.

    3. Changing the rights for an account.

    4. Delete an account.

    See the implementation of Aut::UI::Console for a reference on how this is done using the given aut object.

SEE ALSO

<Aut Framework|Aut>.

AUTHOR

Hans Oesterholt-Dijkema <oesterhol@cpan.org>

COPYRIGHT AND LICENSE

This library is free software; you can redistribute it and/or modify it under Artistic license