$config_hash{'use_roles'} ||= '1';
$config_hash{'start_tls'} ||= '0';
$config_hash{'entry_class'} ||= 'Catalyst::Model::LDAP::Entry';
- $config_hash{'user_class'} ||= 'Catalyst::Authentication::Store::LDAP::User';
+ $config_hash{'user_class'}
+ ||= 'Catalyst::Authentication::Store::LDAP::User';
$config_hash{'role_search_as_user'} ||= 0;
- Catalyst::Utils::ensure_class_loaded($config_hash{'user_class'});
+ Catalyst::Utils::ensure_class_loaded( $config_hash{'user_class'} );
my $self = \%config_hash;
bless( $self, $class );
return $self;
sub get_user {
my ( $self, $id, $c ) = @_;
- my $user = $self->user_class->new( $self,
- $self->lookup_user($id), $c );
+ my $user = $self->user_class->new( $self, $self->lookup_user($id), $c );
return $user;
}
sub ldap_bind {
my ( $self, $ldap, $binddn, $bindpw, $forauth ) = @_;
$forauth ||= 0;
- $ldap ||= $self->ldap_connect;
+ $ldap ||= $self->ldap_connect;
if ( !defined($ldap) ) {
Catalyst::Exception->throw("LDAP Server undefined!");
}
}
}
else {
- $self->_ldap_bind_anon($ldap, $binddn);
+ $self->_ldap_bind_anon( $ldap, $binddn );
}
}
return $ldap;
}
sub _ldap_bind_anon {
- my ($self, $ldap, $dn) = @_;
+ my ( $self, $ldap, $dn ) = @_;
my $mesg = $ldap->bind($dn);
if ( $mesg->is_error ) {
Catalyst::Exception->throw( "Error on Bind: " . $mesg->error );
if ( $id =~ /\*/ ) {
Catalyst::Exception->throw("ID $id contains wildcards!");
}
+
# Trim trailing space or we confuse ourselves
$id =~ s/\s+$//;
my $ldap = $self->ldap_bind;
$attrhash->{ lc($attr) } = \@attrvalues;
}
}
-
- eval { Catalyst::Utils::ensure_class_loaded($self->entry_class) };
+
+ eval { Catalyst::Utils::ensure_class_loaded( $self->entry_class ) };
if ( !$@ ) {
bless( $userentry, $self->entry_class );
$userentry->{_use_unicode}++;
sub from_session {
my ( $self, $c, $id ) = @_;
- $self->get_user($id, $c);
+ $self->get_user( $id, $c );
}
1;