| Server IP : 198.38.94.13 / Your IP : 216.73.217.33 Web Server : Apache System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : revivere ( 1140) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/lib64/python3.9/site-packages/ldap/controls/ |
Upload File : |
"""
ldap.controls.pwdpolicy - classes for Password Policy controls
(see https://tools.ietf.org/html/draft-vchu-ldap-pwd-policy)
See https://www.python-ldap.org/ for project details.
"""
__all__ = [
'PasswordExpiringControl',
'PasswordExpiredControl',
]
# Imports from python-ldap 2.4+
import ldap.controls
from ldap.controls import RequestControl,ResponseControl,ValueLessRequestControl,KNOWN_RESPONSE_CONTROLS
class PasswordExpiringControl(ResponseControl):
"""
Indicates time in seconds when password will expire
"""
controlType = '2.16.840.1.113730.3.4.5'
def decodeControlValue(self,encodedControlValue):
self.gracePeriod = int(encodedControlValue)
KNOWN_RESPONSE_CONTROLS[PasswordExpiringControl.controlType] = PasswordExpiringControl
class PasswordExpiredControl(ResponseControl):
"""
Indicates that password is expired
"""
controlType = '2.16.840.1.113730.3.4.4'
def decodeControlValue(self,encodedControlValue):
self.passwordExpired = encodedControlValue=='0'
KNOWN_RESPONSE_CONTROLS[PasswordExpiredControl.controlType] = PasswordExpiredControl