LSaddon :: samba : added function generate_shadowExpire_from_sambaPwdMustChange()
authorBenjamin Renard <brenard@easter-eggs.com>
Wed, 24 Jul 2013 17:21:25 +0000 (19:21 +0200)
committerBenjamin Renard <brenard@easter-eggs.com>
Wed, 24 Jul 2013 17:21:25 +0000 (19:21 +0200)
public_html/includes/addons/LSaddons.samba.php

index 41c5e6d..c5a521d 100644 (file)
@@ -354,4 +354,20 @@ define('LS_SAMBA_INFINITY_TIME',2147483647);
     return $ldapObject -> getFData(LS_SAMBA_PROFILE_PATH_FORMAT);
   }
 
     return $ldapObject -> getFData(LS_SAMBA_PROFILE_PATH_FORMAT);
   }
 
+ /**
+  * Generation de l'attribut shadowExpire à partir de
+  * l'attribut sambaPwdMustChange
+  *
+  * @author Benjamin Renard <brenard@easter-eggs.com>
+  *
+  * @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 '';
+  }
 ?>
 ?>