Aut

 view release on metacpan or  search on metacpan

Aut/UI/Console.pm  view on Meta::CPAN

=head1 DESCRIPTION

C<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. 

=head2 Note!

=over 1

=item *

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.

=item *

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

=back

=head2 Instantiating and initializing

=head3 C<new() --E<gt> Aut::UI::Console>

=over 1

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

=back

=head3 C<initialize(level::\(list authorization_level:string, admin_level:string) --E<gt> void>

=over 1

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.

=back

=head2 Message related functions

=head3 C<message_ok(msg:string) --E<gt> void>

=over 1

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

=back

=head2 Password related

=head3 C<ask_pass(aut:Aut, msg:string [,any]) --E<gt> string>

=over 1

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, or C<undef>, if an empty
password has been given.

=back

=head3 C<login(aut:Aut [,any]) --E<gt> Aut::Ticket>

=over 1

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 C<aut-E<gt>ticket_get> function.

=back

=head3 C<logout(aut:Aut, ticket:Aut::Ticket,  [,any]) --E<gt> boolean>

=over 1

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.

=back


=head3 C<change_pass(aut:Aut, ticket:Aut::Ticket, [,any] --E<gt> void>

=over 1

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 C<aut-E<gt>check_pass()> and if valid,
store the new password in the ticket using C<ticket-E<gt>set_pass(pass)> and update
the ticket in the backend using C<aut-E<gt>ticket_update(ticket)>.

=back

=head2 Administration 

=head3 C<admin(aut:Aut, ticket, [,any]) --E<gt> void>

=over 1

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:

=over 1

=item 1

Adding new accounts.

=item 2

Changing the password for an account.



( run in 2.072 seconds using v1.01-cache-2.11-cpan-6aa56a78535 )