From 1e9a5bd74c4c1b7d74024359054757020ed20291 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Fri, 27 May 2016 21:17:22 +0200 Subject: [PATCH] Samba history support --- lam/HISTORY | 1 + lam/lib/modules/sambaSamAccount.inc | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lam/HISTORY b/lam/HISTORY index 74013c41..549a895c 100644 --- a/lam/HISTORY +++ b/lam/HISTORY @@ -1,5 +1,6 @@ June 2016 5.4 - Unix: support magic numbers for UIDs/GIDs (e.g. 389 server DNA plugin) + - Samba 3: support for Samba password history - LAM Pro: -> New module for 389ds unlocking and deactivation status -> Self registration: support for Google reCAPTCHA diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index 412d3766..dc56455c 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -2489,12 +2489,13 @@ class sambaSamAccount extends baseModule implements passwordService { * * @param String $password new password */ - private static function oldPasswordUsed($password, $attributes, $sambaDomain) { - if (empty($attributes['sambaPasswordHistory'][0]) || ($sambaDomain == null) + public static function oldPasswordUsed($password, $attributes, $sambaDomain) { + $attributes = array_change_key_case($attributes, CASE_LOWER); + if (empty($attributes['sambapasswordhistory'][0]) || ($sambaDomain == null) || !is_numeric($sambaDomain->pwdHistoryLength) || ($sambaDomain->pwdHistoryLength < 1)) { return false; } - foreach ($attributes['sambaPasswordHistory'] as $historyEntry) { + foreach ($attributes['sambapasswordhistory'] as $historyEntry) { if (sambaSamAccount::validateHistoryEntry($password, $historyEntry)) { return true; }