Univention Bugzilla – Bug 46546
fix s42unix_time()
Last modified: 2020-07-13 11:17:15 CEST
see Bug #46544 def s42unix_time(l): d = 116444736000000000L # difference between 1601 and 1970 - return time.strftime("%d.%m.%y", time.gmtime((l - d) / 10000000)) + return time.strftime("%Y-%m-%d", time.gmtime((l - d) / 10000000)) also for ad-connector
A little bit more descriptive: UDM stores the userexpiry internally as e.g. "2019-10-28" (not as 28.10.19 which is only accepted as input). The function s42unix_time is only used once/twice in the S4-Connector: services/univention-s4-connector/modules/univention/s4connector/s4/__init__.py: 2027 » def disable_user_to_ucs(self, key, object): … 2060 » » » if s42unix_time(int(ldap_object_s4['accountExpires'][0])) != ucs_admin_object['userexpiry']: 2061 » » » » # ucs account not expired -> change 2062 » » » » ucs_admin_object['userexpiry'] = s42unix_time(int(ldap_object_s4['accountExpires'][0])) 2063 » » » » modified = 1 In the case the 'accountExpires' attribute changed on the AD-object the code always evaluates to True and makes a modify() call, even if it's not necessary. It can simply be changed/fixed without side effects.
Julias fixed this along with: 73695b3806 Bug #50202: Fix userexpiry timezone Loop
OK *** This bug has been marked as a duplicate of bug 50202 ***