HEX
Server: LiteSpeed
System: Linux shams.tasjeel.ae 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: infowars (1469)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //usr/lib/python3.9/site-packages/ipapython/__pycache__/ipavalidate.cpython-39.pyc
a

}�f1�@s>ddlZddd�Zddd�Zddd	�Zdd
d�Zddd
�ZdS)�NTcCs�t�dtj�}t�dtj�}|r(|dur8|dur4dSdS|��}|�dd�}z|\}}WntylYdS0|�|�s|dS|�|�s�dSdS)z�Do some basic validation of an e-mail address.
       Return True if ok
       Return False if not

       If notEmpty is True the this will return an error if the field
       is "" or None.
    z^[^ \t\n\r@<>()]+$z ^[a-z0-9][a-z0-9\.\-_]*\.[a-z]+$NTF�@�)�re�compile�I�strip�split�
ValueError�search)Zmail�notEmptyZ
usernameREZdomainRE�s�username�domain�r�9/usr/lib/python3.9/site-packages/ipapython/ipavalidate.py�Emails"

rFcCsL|dus|��s |durdSdS|r0t�d�}n
t�d�}|�|�sHdSdS)z�Do some basic validation of a plain text field
       Return True if ok
       Return False if not

       If notEmpty is True the this will return an error if the field
       is "" or None.
    NTFz^[a-zA-Z_\-0-9\'\ ]*$z^[a-zA-Z_\-0-9\']*$)rrrr
)�textrZallowSpaces�textRErrr�Plain4s

rcCs$|dus|��s |durdSdSdS)z?A string type. This is much looser in what it allows than plainNTF)r)rrrrr�StringKs
rcCsDt�d�}|s|durdS|dur2|dur.dSdS|�|�s@dSdS)z�Do some basic validation of a path
       Return True if ok
       Return False if not

       If notEmpty is True the this will return an error if the field
       is "" or None.
    z^[a-zA-Z_\-0-9\\ \.\/\\:]*$TFN)rrr
)rrrrrr�PathVs

rcCsVt�d�}|s|durdS|dur2|dur.dSdS|�|�}|rN||�d�krRdSdS)a&From shadow-utils:

       User/group names must match gnu e-regex:
       [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]?

       as a non-POSIX, extension, allow "$" as the last char for
       sake of Samba 3.x "add machine script"

       Return True if ok
       Return False if not
    z3^[a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]?$TFNr)rr�match�group)rrr�mrrr�GoodNamens

r)T)FT)F)F)F)rrrrrrrrrr�<module>s