LEMONLDAP::NG : web form in a distinct file
This commit is contained in:
parent
a72eebdd81
commit
d99ef1ba3f
|
@ -78,6 +78,7 @@ example/slavePortal.pl
|
|||
lib/Lemonldap/NG/Portal.pm
|
||||
lib/Lemonldap/NG/Portal/_i18n.pm
|
||||
lib/Lemonldap/NG/Portal/_LDAP.pm
|
||||
lib/Lemonldap/NG/Portal/_WebForm.pm
|
||||
lib/Lemonldap/NG/Portal/AuthApache.pm
|
||||
lib/Lemonldap/NG/Portal/AuthCAS.pm
|
||||
lib/Lemonldap/NG/Portal/AuthLA.pm
|
||||
|
|
|
@ -2,8 +2,10 @@ package Lemonldap::NG::Portal::AuthLDAP;
|
|||
|
||||
use Lemonldap::NG::Portal::Simple;
|
||||
use Lemonldap::NG::Portal::_LDAP;
|
||||
use Lemonldap::NG::Portal::_WebForm;
|
||||
|
||||
our $VERSION = '0.1';
|
||||
our @ISA = qw(Lemonldap::NG::Portal::_WebForm);
|
||||
|
||||
sub ldap {
|
||||
my $self = shift;
|
||||
|
@ -17,31 +19,6 @@ sub ldap {
|
|||
return $self->{ldap};
|
||||
}
|
||||
|
||||
sub authInit {
|
||||
PE_OK;
|
||||
}
|
||||
|
||||
sub extractFormInfo {
|
||||
my $self = shift;
|
||||
return PE_FIRSTACCESS
|
||||
unless ( $self->param('user') );
|
||||
return PE_FORMEMPTY
|
||||
unless ( length( $self->{'user'} = $self->param('user') ) > 0
|
||||
&& length( $self->{'password'} = $self->param('password') ) > 0 );
|
||||
PE_OK;
|
||||
}
|
||||
|
||||
sub setAuthSessionInfo {
|
||||
my $self = shift;
|
||||
|
||||
# Store submitted password if set in configuration
|
||||
# WARNING: it can be a security hole
|
||||
if ( $self->{storePassword} ) {
|
||||
$self->{sessionInfo}->{'_password'} = $self->{'password'};
|
||||
}
|
||||
PE_OK;
|
||||
}
|
||||
|
||||
sub authenticate {
|
||||
my $self = shift;
|
||||
unless ( $self->ldap ) {
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package Lemonldap::NG::Portal::_WebForm;
|
||||
|
||||
use Lemonldap::NG::Portal::Simple qw(:all);
|
||||
use strict;
|
||||
|
||||
sub authInit {
|
||||
PE_OK;
|
||||
}
|
||||
|
||||
sub extractFormInfo {
|
||||
my $self = shift;
|
||||
return PE_FIRSTACCESS
|
||||
unless ( $self->param('user') );
|
||||
return PE_FORMEMPTY
|
||||
unless ( length( $self->{'user'} = $self->param('user') ) > 0
|
||||
&& length( $self->{'password'} = $self->param('password') ) > 0 );
|
||||
PE_OK;
|
||||
}
|
||||
|
||||
sub setAuthSessionInfo {
|
||||
my $self = shift;
|
||||
|
||||
# Store submitted password if set in configuration
|
||||
# WARNING: it can be a security hole
|
||||
if ( $self->{storePassword} ) {
|
||||
$self->{sessionInfo}->{'_password'} = $self->{'password'};
|
||||
}
|
||||
PE_OK;
|
||||
}
|
||||
|
||||
1;
|
Loading…
Reference in New Issue
Block a user