Revision 5d23fb60
Von Sven Schöling vor mehr als 14 Jahren hinzugefügt
SL/Auth/LDAP.pm | ||
---|---|---|
2 | 2 |
|
3 | 3 |
use English '-no_match_vars'; |
4 | 4 |
|
5 |
#use SL::Auth;
|
|
5 |
use SL::Auth::Constants qw(:all);
|
|
6 | 6 |
|
7 | 7 |
use strict; |
8 | 8 |
|
... | ... | |
146 | 146 |
|
147 | 147 |
if ($is_crypted) { |
148 | 148 |
$main::lxdebug->leave_sub(); |
149 |
return SL::Auth->ERR_BACKEND();
|
|
149 |
return ERR_BACKEND;
|
|
150 | 150 |
} |
151 | 151 |
|
152 | 152 |
my $ldap = $self->_connect(); |
153 | 153 |
|
154 | 154 |
if (!$ldap) { |
155 | 155 |
$main::lxdebug->leave_sub(); |
156 |
return SL::Auth->ERR_BACKEND();
|
|
156 |
return ERR_BACKEND;
|
|
157 | 157 |
} |
158 | 158 |
|
159 | 159 |
my $dn = $self->_get_user_dn($ldap, $login); |
... | ... | |
162 | 162 |
|
163 | 163 |
if (!$dn) { |
164 | 164 |
$main::lxdebug->leave_sub(); |
165 |
return SL::Auth->ERR_BACKEND();
|
|
165 |
return ERR_BACKEND;
|
|
166 | 166 |
} |
167 | 167 |
|
168 | 168 |
my $mesg = $ldap->bind($dn, 'password' => $password); |
... | ... | |
171 | 171 |
|
172 | 172 |
$main::lxdebug->leave_sub(); |
173 | 173 |
|
174 |
return $mesg->is_error() ? SL::Auth->ERR_PASSWORD() : SL::Auth->OK();
|
|
174 |
return $mesg->is_error() ? ERR_PASSWORD : OK;
|
|
175 | 175 |
} |
176 | 176 |
|
177 | 177 |
sub can_change_password { |
... | ... | |
179 | 179 |
} |
180 | 180 |
|
181 | 181 |
sub change_password { |
182 |
return SL::Auth->ERR_BACKEND();
|
|
182 |
return ERR_BACKEND;
|
|
183 | 183 |
} |
184 | 184 |
|
185 | 185 |
sub verify_config { |
Auch abrufbar als: Unified diff
Auth Konstanten ausgelagert in ein eigenes Package.
Dadurch keine Probleme mit zirkulären Includes mehr. Ausserdem DBI an der richtigen Stelle eingebunden.