Revision c510d88b
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
SL/Auth/LDAP.pm | ||
---|---|---|
4 | 4 |
|
5 | 5 |
#use SL::Auth; |
6 | 6 |
|
7 |
use strict; |
|
8 |
|
|
7 | 9 |
sub new { |
8 | 10 |
$main::lxdebug->enter_sub(); |
9 | 11 |
|
... | ... | |
144 | 146 |
|
145 | 147 |
if ($is_crypted) { |
146 | 148 |
$main::lxdebug->leave_sub(); |
147 |
return SL::Auth::ERR_BACKEND;
|
|
149 |
return SL::Auth->ERR_BACKEND();
|
|
148 | 150 |
} |
149 | 151 |
|
150 | 152 |
my $ldap = $self->_connect(); |
151 | 153 |
|
152 | 154 |
if (!$ldap) { |
153 | 155 |
$main::lxdebug->leave_sub(); |
154 |
return SL::Auth::ERR_BACKEND;
|
|
156 |
return SL::Auth->ERR_BACKEND();
|
|
155 | 157 |
} |
156 | 158 |
|
157 | 159 |
my $dn = $self->_get_user_dn($ldap, $login); |
158 | 160 |
|
159 |
$main::lxdebug->message(LXDebug::DEBUG2, "LDAP authenticate: dn $dn");
|
|
161 |
$main::lxdebug->message(LXDebug->DEBUG2(), "LDAP authenticate: dn $dn");
|
|
160 | 162 |
|
161 | 163 |
if (!$dn) { |
162 | 164 |
$main::lxdebug->leave_sub(); |
163 |
return SL::Auth::ERR_BACKEND;
|
|
165 |
return SL::Auth->ERR_BACKEND();
|
|
164 | 166 |
} |
165 | 167 |
|
166 | 168 |
my $mesg = $ldap->bind($dn, 'password' => $password); |
167 | 169 |
|
168 |
$main::lxdebug->message(LXDebug::DEBUG2, "LDAP authenticate: bind mesg " . $mesg->error());
|
|
170 |
$main::lxdebug->message(LXDebug->DEBUG2(), "LDAP authenticate: bind mesg " . $mesg->error());
|
|
169 | 171 |
|
170 | 172 |
$main::lxdebug->leave_sub(); |
171 | 173 |
|
172 |
return $mesg->is_error() ? SL::Auth::ERR_PASSWORD : SL::Auth::OK;
|
|
174 |
return $mesg->is_error() ? SL::Auth->ERR_PASSWORD() : SL::Auth->OK();
|
|
173 | 175 |
} |
174 | 176 |
|
175 | 177 |
sub can_change_password { |
... | ... | |
177 | 179 |
} |
178 | 180 |
|
179 | 181 |
sub change_password { |
180 |
return SL::Auth::ERR_BACKEND;
|
|
182 |
return SL::Auth->ERR_BACKEND();
|
|
181 | 183 |
} |
182 | 184 |
|
183 | 185 |
sub verify_config { |
184 | 186 |
$main::lxdebug->enter_sub(); |
185 | 187 |
|
188 |
my $form = $main::form; |
|
189 |
my $locale = $main::locale; |
|
190 |
|
|
186 | 191 |
my $self = shift; |
187 | 192 |
my $cfg = $self->{auth}->{LDAP_config}; |
188 | 193 |
|
Auch abrufbar als: Unified diff
und die restlichen .pm Module.