From 45205a1b6adb32bb714755058c56c6d8301873b7 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 24 Jul 2013 19:21:25 +0200 Subject: [PATCH] LSaddon :: samba : added function generate_shadowExpire_from_sambaPwdMustChange() --- public_html/includes/addons/LSaddons.samba.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/public_html/includes/addons/LSaddons.samba.php b/public_html/includes/addons/LSaddons.samba.php index 41c5e6d7..c5a521d1 100644 --- a/public_html/includes/addons/LSaddons.samba.php +++ b/public_html/includes/addons/LSaddons.samba.php @@ -354,4 +354,20 @@ define('LS_SAMBA_INFINITY_TIME',2147483647); return $ldapObject -> getFData(LS_SAMBA_PROFILE_PATH_FORMAT); } + /** + * Generation de l'attribut shadowExpire à partir de + * l'attribut sambaPwdMustChange + * + * @author Benjamin Renard + * + * @retval string La valeur de shadowExpire + */ + function generate_shadowExpire_from_sambaPwdMustChange($ldapObject) { + $time=$ldapObject -> getValue('sambaPwdMustChange'); + if (!empty($time)) { + $time=(int)$time[0]; + return (string)round($time/86400); + } + return ''; + } ?>