From 4e8a6db06b3ba012ea8f6a42ca09430a7ac79d77 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Tue, 1 Dec 2020 16:37:01 +0100 Subject: [PATCH] LSaddon::posix: fix generate_shadowLastChange() Just return a timestamp because its designed to be used with LSattr_ldap_shadowExpire that will handled the division by 86400. --- src/includes/addons/LSaddons.posix.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/includes/addons/LSaddons.posix.php b/src/includes/addons/LSaddons.posix.php index 24cd27a0..d80988ea 100644 --- a/src/includes/addons/LSaddons.posix.php +++ b/src/includes/addons/LSaddons.posix.php @@ -268,6 +268,11 @@ LSerror :: defineError('POSIX_01', * * Just return a shadowLastChange value corresponding to current date. * + * Important: this function is designed to be used with LSattr_html_date + * & LSattr_ldap_shadowExpire classes. The returned value is just a timestamp + * and it will be converted by LSattr_ldap_shadowExpire as raw LDAP value, that is, + * divided by 86400. + * * @author Benjamin Renard * * @param[in] $anything anything @@ -275,5 +280,5 @@ LSerror :: defineError('POSIX_01', * @retval integer The shadowLastChange attribute value (=current date) */ function generate_shadowLastChange($anything) { - return time()/86400; + return time(); }