Lines 1094-1101
def posixSecondsToLocaltimeDate(seconds):
|
Link Here
|
---|
|
1094 |
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(seconds)) |
1094 |
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(seconds)) |
1095 |
|
1095 |
|
1096 |
|
1096 |
|
1097 |
def posixDaysToDate(days): |
1097 |
def posixDaysToLocalDate(days): |
1098 |
return time.strftime("%Y-%m-%d", time.gmtime(long(days) * 3600 * 24)) |
1098 |
return time.strftime("%Y-%m-%d", time.localtime(long(days) * 3600 * 24)) |
1099 |
|
1099 |
|
1100 |
|
1100 |
|
1101 |
def sambaWorkstationsMap(workstations): |
1101 |
def sambaWorkstationsMap(workstations): |
Lines 1267-1288
def unmapShadowExpireToUserexpiry(oldattr):
|
Link Here
|
---|
|
1267 |
# shadowExpire contains the absolute date to expire the account. |
1267 |
# shadowExpire contains the absolute date to expire the account. |
1268 |
|
1268 |
|
1269 |
if 'shadowExpire' in oldattr and len(oldattr['shadowExpire']) > 0: |
1269 |
if 'shadowExpire' in oldattr and len(oldattr['shadowExpire']) > 0: |
1270 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'userexpiry: %s' % posixDaysToDate(oldattr['shadowExpire'][0])) |
1270 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'userexpiry: %s' % posixDaysToLocalDate(oldattr['shadowExpire'][0])) |
1271 |
if oldattr['shadowExpire'][0] != '1': |
1271 |
if oldattr['shadowExpire'][0] != '1': |
1272 |
return posixDaysToDate(oldattr['shadowExpire'][0]) |
1272 |
return posixDaysToLocalDate(oldattr['shadowExpire'][0]) |
1273 |
|
1273 |
|
1274 |
|
1274 |
|
1275 |
def unmapKrb5ValidEndToUserexpiry(oldattr): |
1275 |
def unmapKrb5ValidEndToUserexpiry(oldattr): |
1276 |
if 'krb5ValidEnd' in oldattr: |
1276 |
if 'krb5ValidEnd' in oldattr: |
1277 |
krb5validend = oldattr['krb5ValidEnd'][0] |
1277 |
krb5validend = oldattr['krb5ValidEnd'][0] |
1278 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'krb5validend is: %s' % krb5validend) |
1278 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'krb5validend is: %s' % krb5validend) |
1279 |
return "%s-%s-%s" % (krb5validend[0:4], krb5validend[4:6], krb5validend[6:8]) |
1279 |
userexpiry_epoch = calendar.timegm(time.strptime(krb5validend, '%Y%m%d%H%M%SZ')) |
|
|
1280 |
return time.strftime("%Y-%m-%d", time.localtime(userexpiry_epoch)) |
1280 |
|
1281 |
|
1281 |
|
1282 |
|
1282 |
def unmapSambaKickoffTimeToUserexpiry(oldattr): |
1283 |
def unmapSambaKickoffTimeToUserexpiry(oldattr): |
1283 |
if 'sambaKickoffTime' in oldattr: |
1284 |
if 'sambaKickoffTime' in oldattr: |
1284 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'sambaKickoffTime is: %s' % oldattr['sambaKickoffTime'][0]) |
1285 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'sambaKickoffTime is: %s' % oldattr['sambaKickoffTime'][0]) |
1285 |
return time.strftime("%Y-%m-%d", time.gmtime(long(oldattr['sambaKickoffTime'][0]) + (3600 * 24))) |
1286 |
return time.strftime("%Y-%m-%d", time.localtime(long(oldattr['sambaKickoffTime'][0]) + (3600 * 24))) |
1286 |
|
1287 |
|
1287 |
|
1288 |
|
1288 |
def unmapPasswordExpiry(oldattr): |
1289 |
def unmapPasswordExpiry(oldattr): |
Lines 1293-1299
def unmapPasswordExpiry(oldattr):
|
Link Here
|
---|
|
1293 |
shadow_last_change = int(oldattr['shadowLastChange'][0]) |
1294 |
shadow_last_change = int(oldattr['shadowLastChange'][0]) |
1294 |
except ValueError: |
1295 |
except ValueError: |
1295 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.WARN, 'users/user: failed to calculate password expiration correctly, use only shadowMax instead') |
1296 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.WARN, 'users/user: failed to calculate password expiration correctly, use only shadowMax instead') |
1296 |
return posixDaysToDate(shadow_last_change + shadow_max) |
1297 |
return posixDaysToLocalDate(shadow_last_change + shadow_max) |
1297 |
|
1298 |
|
1298 |
|
1299 |
|
1299 |
def unmapDisabled(oldattr): |
1300 |
def unmapDisabled(oldattr): |
Lines 2048-2054
class object(univention.admin.handlers.simpleLdap):
|
Link Here
|
---|
|
2048 |
return ml |
2049 |
return ml |
2049 |
|
2050 |
|
2050 |
krb_keys = univention.admin.password.krb5_asn1(self.krb5_principal(), self['password']) |
2051 |
krb_keys = univention.admin.password.krb5_asn1(self.krb5_principal(), self['password']) |
2051 |
krb_key_version = str(int(self.oldattr.get('krb5KeyVersionNumber', ['0'])[0]) + 1) |
2052 |
krb_key_version = str(int(self.oldattr.get('krb5KeyVersionNumber', ['0'])[0])) |
2052 |
ml.append(('krb5Key', self.oldattr.get('krb5Key', []), krb_keys)) |
2053 |
ml.append(('krb5Key', self.oldattr.get('krb5Key', []), krb_keys)) |
2053 |
ml.append(('krb5KeyVersionNumber', self.oldattr.get('krb5KeyVersionNumber', []), krb_key_version)) |
2054 |
ml.append(('krb5KeyVersionNumber', self.oldattr.get('krb5KeyVersionNumber', []), krb_key_version)) |
2054 |
return ml |
2055 |
return ml |
Lines 2193-2199
class object(univention.admin.handlers.simpleLdap):
|
Link Here
|
---|
|
2193 |
if self.hasChanged('userexpiry'): |
2194 |
if self.hasChanged('userexpiry'): |
2194 |
krb5ValidEnd = '' |
2195 |
krb5ValidEnd = '' |
2195 |
if self['userexpiry']: |
2196 |
if self['userexpiry']: |
2196 |
krb5ValidEnd = "%s%s%s000000Z" % (self['userexpiry'][0:4], self['userexpiry'][5:7], self['userexpiry'][8:10]) |
2197 |
userexpiry_epoch = time.mktime(time.strptime(self['userexpiry'], "%Y-%m-%d")) |
|
|
2198 |
krb5ValidEnd = time.strftime("%Y%m%d000000Z", time.gmtime(userexpiry_epoch)) |
2197 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'krb5ValidEnd: %s' % krb5ValidEnd) |
2199 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'krb5ValidEnd: %s' % krb5ValidEnd) |
2198 |
old_krb5ValidEnd = self.oldattr.get('krb5ValidEnd', '') |
2200 |
old_krb5ValidEnd = self.oldattr.get('krb5ValidEnd', '') |
2199 |
if old_krb5ValidEnd != krb5ValidEnd: |
2201 |
if old_krb5ValidEnd != krb5ValidEnd: |
Lines 2208-2214
class object(univention.admin.handlers.simpleLdap):
|
Link Here
|
---|
|
2208 |
if self['disabled'] == '1' and self.hasChanged('disabled') and not self.hasChanged('userexpiry'): |
2210 |
if self['disabled'] == '1' and self.hasChanged('disabled') and not self.hasChanged('userexpiry'): |
2209 |
shadowExpire = '1' |
2211 |
shadowExpire = '1' |
2210 |
elif self['userexpiry']: |
2212 |
elif self['userexpiry']: |
2211 |
shadowExpire = "%d" % long(time.mktime(time.strptime(self['userexpiry'], "%Y-%m-%d")) / 3600 / 24 + 1) |
2213 |
shadowExpire = "%d" % long(time.mktime(time.strptime(self['userexpiry'], "%Y-%m-%d")) / 3600 / 24) |
2212 |
elif self['disabled'] == '1': |
2214 |
elif self['disabled'] == '1': |
2213 |
shadowExpire = '1' |
2215 |
shadowExpire = '1' |
2214 |
else: |
2216 |
else: |