Skip to content

Commit

Permalink
Merge branch 'rel-11_0' into rel-11_1
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Feb 16, 2025
2 parents 7930ee3 + bdcc38f commit f8ba2cb
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 252 deletions.
172 changes: 0 additions & 172 deletions .github/workflows/docker_image_update_checker.yml

This file was deleted.

19 changes: 9 additions & 10 deletions Kernel/System/Auth/DB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ use warnings;
use Digest::SHA ();

# CPAN modules
use Crypt::PasswdMD5 qw(apache_md5_crypt unix_md5_crypt);

# OTOBO modules
use Crypt::PasswdMD5 qw(apache_md5_crypt unix_md5_crypt);

our @ObjectDependencies = (
'Kernel::Config',
Expand All @@ -48,7 +48,7 @@ sub new {
# allocate new hash for object
my $Self = bless {}, $Type;

# get config object
# get needed objects
my $ConfigObject = $Kernel::OM->Get('Kernel::Config');

# get user table
Expand Down Expand Up @@ -94,6 +94,7 @@ sub Auth {
Priority => 'error',
Message => "Need User!"
);

return;
}

Expand All @@ -103,7 +104,7 @@ sub Auth {
my $ParamObject = $Kernel::OM->Get('Kernel::System::Web::Request');
my $RemoteAddr = $ParamObject->RemoteAddr() || 'Got no REMOTE_ADDR env!';
my $UserID = '';
my $GetPw = '';
my $GetPw = ''; # the hashed password, may include salt and other settings
my $Method = '';

# get database object
Expand Down Expand Up @@ -164,7 +165,6 @@ sub Auth {
$CryptedPw = unix_md5_crypt( $Pw, $Salt );
$Method = 'unix_md5_crypt';
}

}

# sha256 pw
Expand All @@ -190,13 +190,13 @@ sub Auth {
elsif ( $GetPw =~ m{^BCRYPT:} ) {

# require module, log errors if module was not found
if ( !$Kernel::OM->Get('Kernel::System::Main')->Require('Crypt::Eksblowfish::Bcrypt') )
{
if ( !$Kernel::OM->Get('Kernel::System::Main')->Require('Crypt::Eksblowfish::Bcrypt') ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message =>
"User: $User tried to authenticate with bcrypt but 'Crypt::Eksblowfish::Bcrypt' is not installed!",
);

return;
}

Expand Down Expand Up @@ -248,7 +248,7 @@ sub Auth {
# crypt pw
else {

# strip Salt only for (Extended) DES, not for any of Modular crypt's
# strip salt only for (Extended) DES, not for any of modular crypts
if ( $Salt !~ /^\$\d\$/ ) {
$Salt =~ s/^(..).*/$1/;
}
Expand Down Expand Up @@ -291,8 +291,7 @@ sub Auth {
}

# login note
elsif ( ( ($GetPw) && ($User) && ($UserID) ) && $CryptedPw eq $GetPw ) {

elsif ( $GetPw && $User && $UserID && $CryptedPw eq $GetPw ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'notice',
Message => "User: $User authentication ok (Method: $Method, REMOTE_ADDR: $RemoteAddr).",
Expand All @@ -302,7 +301,7 @@ sub Auth {
}

# just a note
elsif ( ($UserID) && ($GetPw) ) {
elsif ( $UserID && $GetPw ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'notice',
Message =>
Expand Down
Loading

0 comments on commit f8ba2cb

Please sign in to comment.