|
Lines 36-41
import string
Link Here
|
| 36 |
import re |
36 |
import re |
| 37 |
import copy |
37 |
import copy |
| 38 |
import time |
38 |
import time |
|
|
39 |
import calendar |
| 39 |
import types |
40 |
import types |
| 40 |
import struct |
41 |
import struct |
| 41 |
from M2Crypto import X509 |
42 |
from M2Crypto import X509 |
|
Lines 1138-1145
def case_insensitive_in_list(dn, list):
Link Here
|
| 1138 |
return False |
1139 |
return False |
| 1139 |
|
1140 |
|
| 1140 |
|
1141 |
|
|
|
1142 |
def posixSecondsToDate(seconds): |
| 1143 |
return time.strftime("%Y-%m-%d", time.gmtime(seconds)) |
| 1144 |
|
| 1145 |
|
| 1141 |
def posixDaysToDate(days): |
1146 |
def posixDaysToDate(days): |
| 1142 |
return time.strftime("%Y-%m-%d", time.gmtime(long(days) * 3600 * 24)) |
1147 |
return posixSecondsToDate(long(days) * 3600 * 24) |
|
|
1148 |
|
| 1149 |
|
| 1150 |
def dateToPosixSeconds(iso_date): |
| 1151 |
return calendar.timegm(time.strptime(iso_date, "%Y-%m-%d")) |
| 1152 |
|
| 1153 |
|
| 1154 |
def dateToPosixDays(iso_date): |
| 1155 |
return dateToPosixSeconds(iso_date) / 3600 / 24 |
| 1143 |
|
1156 |
|
| 1144 |
|
1157 |
|
| 1145 |
def sambaWorkstationsMap(workstations): |
1158 |
def sambaWorkstationsMap(workstations): |
|
Lines 1474-1480
class object(univention.admin.handlers.simpleLdap, mungeddial.Support):
Link Here
|
| 1474 |
elif 'samba' in self.options: |
1487 |
elif 'samba' in self.options: |
| 1475 |
if self.oldattr.has_key('sambaKickoffTime'): |
1488 |
if self.oldattr.has_key('sambaKickoffTime'): |
| 1476 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'sambaKickoffTime is: %s' % self.oldattr['sambaKickoffTime'][0]) |
1489 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'sambaKickoffTime is: %s' % self.oldattr['sambaKickoffTime'][0]) |
| 1477 |
self.info['userexpiry'] = time.strftime("%Y-%m-%d", time.gmtime(long(self.oldattr['sambaKickoffTime'][0]) + (3600 * 24))) |
1490 |
self.info['userexpiry'] = posixSecondsToDate(self.oldattr['sambaKickoffTime'][0]) |
| 1478 |
|
1491 |
|
| 1479 |
try: |
1492 |
try: |
| 1480 |
givenName = self.oldattr.get('givenName', [''])[0] |
1493 |
givenName = self.oldattr.get('givenName', [''])[0] |
|
Lines 2307-2313
class object(univention.admin.handlers.simpleLdap, mungeddial.Support):
Link Here
|
| 2307 |
if 'samba' in self.options: |
2320 |
if 'samba' in self.options: |
| 2308 |
sambaKickoffTime = '' |
2321 |
sambaKickoffTime = '' |
| 2309 |
if self['userexpiry']: |
2322 |
if self['userexpiry']: |
| 2310 |
sambaKickoffTime = "%d" % long(time.mktime(time.strptime(self['userexpiry'], "%Y-%m-%d"))) |
2323 |
sambaKickoffTime = str(dateToPosixSeconds(self['userexpiry'])) |
| 2311 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'sambaKickoffTime: %s' % sambaKickoffTime) |
2324 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'sambaKickoffTime: %s' % sambaKickoffTime) |
| 2312 |
old_sambaKickoffTime = self.oldattr.get('sambaKickoffTime', '') |
2325 |
old_sambaKickoffTime = self.oldattr.get('sambaKickoffTime', '') |
| 2313 |
if old_sambaKickoffTime != sambaKickoffTime: |
2326 |
if old_sambaKickoffTime != sambaKickoffTime: |
|
Lines 2329-2335
class object(univention.admin.handlers.simpleLdap, mungeddial.Support):
Link Here
|
| 2329 |
if self.__is_posix_disabled() and self.hasChanged('disabled') and not self.hasChanged('userexpiry'): |
2342 |
if self.__is_posix_disabled() and self.hasChanged('disabled') and not self.hasChanged('userexpiry'): |
| 2330 |
shadowExpire = '1' |
2343 |
shadowExpire = '1' |
| 2331 |
elif self['userexpiry']: |
2344 |
elif self['userexpiry']: |
| 2332 |
shadowExpire = "%d" % long(time.mktime(time.strptime(self['userexpiry'], "%Y-%m-%d")) / 3600 / 24 + 1) |
2345 |
shadowExpire = str(dateToPosixDays(self['userexpiry'])) |
| 2333 |
elif self.__is_posix_disabled(): |
2346 |
elif self.__is_posix_disabled(): |
| 2334 |
shadowExpire = '1' |
2347 |
shadowExpire = '1' |
| 2335 |
else: |
2348 |
else: |
| 2336 |
- |
|
|
| 2337 |
special posix cases |
2349 |
special posix cases |
| 2338 |
-- |
|
|
| 2339 |
.../tests/61_udm-users/25_script_lock_expired_accounts | 10 +++++----- |
2350 |
.../tests/61_udm-users/25_script_lock_expired_accounts | 10 +++++----- |
| 2340 |
.../tests/61_udm-users/25_script_lock_expired_passwords | 6 +++--- |
2351 |
.../tests/61_udm-users/25_script_lock_expired_passwords | 6 +++--- |
| 2341 |
2 files changed, 8 insertions(+), 8 deletions(-) |
2352 |
2 files changed, 8 insertions(+), 8 deletions(-) |