« blib/lib/Lemonldap/NG/Portal/Auth/Null.pm
↑ Summary
blib/lib/Lemonldap/NG/Portal/UserDB/Remote.pm »
| 1 | ##@file | ||||||||||
| 2 | # Demo authentication backend file | ||||||||||
| 3 | |||||||||||
| 4 | ##@class | ||||||||||
| 5 | # Demo authentication backend class | ||||||||||
| 6 | package Lemonldap::NG::Portal::Auth::Demo; | ||||||||||
| 7 | |||||||||||
| 8 | 317 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 317 | ▶ | use Mouse; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 317 | ▶ | use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_BADCREDENTIALS); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 317 | extends qw(Lemonldap::NG::Portal::Auth::_WebForm); | |||||||||
| 13 | |||||||||||
| 14 | 317 | our $VERSION = '2.0.12'; | |||||||||
| 15 | |||||||||||
| 16 | # INITIALIZATION | ||||||||||
| 17 | |||||||||||
| 18 | # Initialize demo accounts | ||||||||||
| 19 | # @return Lemonldap::NG::Portal constant | ||||||||||
| 20 | 652 | ▶ | sub init { | ||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 21 | 652 | my $self = shift; | |||||||||
| 22 | |||||||||||
| 23 | # Add warning in log | ||||||||||
| 24 | 652 | $self->logger->warn( | |||||||||
| 25 | "Using demonstration mode, go to Manager to edit the configuration"); | ||||||||||
| 26 | |||||||||||
| 27 | 652 | return $self->Lemonldap::NG::Portal::Auth::_WebForm::init(); | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | # RUNNING METHODS | ||||||||||
| 31 | |||||||||||
| 32 | 107 | ▶ | sub authenticate { | ||||||||
|
Subroutine
authenticate: called CC=2 SCAR=9.2
Pod
undocumented
| |||||||||||
| 33 | 107 | my ( $self, $req ) = @_; | |||||||||
| 34 | |||||||||||
| 35 | 107 | ▶ | unless ( $req->{user} eq $req->data->{password} ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | 0 | $self->userLogger->warn("Bad password for $req->{user}"); | |||||||||
| 37 | 0 | $self->setSecurity($req); | |||||||||
| 38 | 0 | return PE_BADCREDENTIALS; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 107 | return PE_OK; | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 27 | ▶ | sub authLogout { | ||||||||
|
Subroutine
authLogout: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 45 | 27 | return PE_OK; | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 317 | 1; | |||||||||