Skip to content

Commit

Permalink
Merge branch 'hotfix/3.1.3.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsteampassnet committed Jan 28, 2025
2 parents aacdf6a + 4ddcd77 commit 6a580fa
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions sources/main.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -3227,14 +3227,12 @@ function changeUserAuthenticationPassword(
* @param integer $post_user_id
* @param string $post_previous_pwd
* @param string $post_current_pwd
* @param array $SETTINGS
* @return string
*/
function changeUserLDAPAuthenticationPassword(
int $post_user_id,
string $post_previous_pwd,
string $post_current_pwd,
array $SETTINGS
string $post_current_pwd
)
{
$session = SessionManager::getSession();
Expand All @@ -3249,7 +3247,7 @@ function changeUserLDAPAuthenticationPassword(
WHERE id = %i',
$post_user_id
);

if (DB::count() > 0 && empty($userData['private_key']) === false) {
// Now check if current password is correct (only if not ldap)
if ($userData['auth_type'] === 'ldap' && $userData['special'] === 'auth-pwd-change') {
Expand Down Expand Up @@ -3298,12 +3296,13 @@ function changeUserLDAPAuthenticationPassword(
'encode'
);
}

// Get one itemKey from current user
$currentUserKey = DB::queryFirstRow(
'SELECT share_key, increment_id
FROM ' . prefixTable('sharekeys_items') . '
WHERE user_id = %i
'SELECT ski.share_key, ski.increment_id, l.id_user
FROM ' . prefixTable('sharekeys_items') . ' AS ski
INNER JOIN ' . prefixTable('log_items') . ' AS l ON ski.object_id = l.id_item
WHERE ski.user_id = %i
ORDER BY RAND()
LIMIT 1',
$post_user_id
);
Expand Down

0 comments on commit 6a580fa

Please sign in to comment.