package SL::Auth::DB;
-use DBI;
-
-use SL::Auth;
+use SL::Auth::Constants qw(:all);
use SL::DBUtils;
+use strict;
+
sub new {
$main::lxdebug->enter_sub();
if (!$dbh) {
$main::lxdebug->leave_sub();
- return SL::Auth::ERR_BACKEND;
+ return ERR_BACKEND;
}
my $query = qq|SELECT password FROM auth."user" WHERE login = ?|;
$main::lxdebug->leave_sub();
- return $password eq $stored_password ? SL::Auth::OK : SL::Auth::ERR_PASSWORD;
+ return $password eq $stored_password ? OK : ERR_PASSWORD;
}
sub can_change_password {
if (!$dbh) {
$main::lxdebug->leave_sub();
- return SL::Auth::ERR_BACKEND
+ return ERR_BACKEND;
}
$password = crypt $password, substr($login, 0, 2) if (!$is_crypted);