Univention Bugzilla – Bug 33989
Function logonHoursUnmap in UDM module users/user suspicious
Last modified: 2017-06-28 18:32:24 CEST
The following function in the users/user UDM module seems suspicious, does it actually work, as "times" is not being modified, thus the while condition seems to stay True once it is True. (Also the indentation is mixed with spaces/tabs, I am not sure which indentation is correct.) def logonHoursUnmap(logontimes): "converts the string to a bit array" times=logontimes[0][:42] while len(times)<42: times=times ret="" for i in range(0,42,2): val=int(times[i:i+2],16) ret+=intToBinary(val)
Indentation is correct. 1 Tab = 8 Space if mixed (but this should be avoided). def logonHoursUnmap(logontimes): "converts the string to a bit array" times=logontimes[0][:42] while len(times)<42: times=times ret="" for i in range(0,42,2): val=int(times[i:i+2],16) ret+=intToBinary(val) BTW. I prefer DUPLICATE with Bug #28496 (rewrite sambaLogonHoursMap/Unmap)
Sorry def logonHoursUnmap(logontimes): "converts the string to a bit array" times=logontimes[0][:42] while len(times)<42: times=times ret="" for i in range(0,42,2): val=int(times[i:i+2],16) ret+=intToBinary(val)
*** This bug has been marked as a duplicate of bug 28496 ***