403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/django/contrib/auth/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/django/contrib/auth/__pycache__/forms.cpython-311.pyc
�

48zj�@��n�ddlZddlZddlmZddlmZmZmZddlm	Z	m
Z
ddlmZddl
mZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZmZ e��Z!ej"d��Z#d�Z$Gd�dej%��Z&Gd�dej'��Z(Gd�dej)��Z*Gd�dej+��Z,Gd�dej+��Z-Gd�dej.��Z/Gd�dej.��Z0Gd�d ej.��Z1Gd!�d"e1��Z2Gd#�d$ej.��Z3dS)%�N)�forms)�authenticate�get_user_model�password_validation)�UNUSABLE_PASSWORD_PREFIX�identify_hasher)�User)�default_token_generator)�get_current_site)�ValidationError)�EmailMultiAlternatives)�loader)�force_bytes)�urlsafe_base64_encode)�capfirst)�gettext�gettext_lazyzdjango.contrib.authc��tjd|�����tjd|�����kS)z�
    Perform case-insensitive comparison of two identifiers, using the
    recommended algorithm from Unicode Technical Report 36, section
    2.11.2(B)(2).
    �NFKC)�unicodedata�	normalize�casefold)�s1�s2s  �;/usr/lib/python3/dist-packages/django/contrib/auth/forms.py�_unicode_ci_comparersC��� ���,�,�5�5�7�7�;�;P�QW�Y[�;\�;\�;e�;e�;g�;g�g�g�c�&��eZdZdZdZ�fd�Z�xZS)�ReadOnlyPasswordHashWidgetz)auth/widgets/read_only_password_hash.htmlTc���t���|||��}g}|r|�t��r%|�dtd��i��n�	t
|��}|�|�����D]*\}}|�t|��|d����+n4#t$r'|�dtd��i��YnwxYw||d<|S)N�labelzNo password set.)r!�valuez5Invalid password format or unknown hashing algorithm.�summary)
�super�get_context�
startswithr�appendrr�safe_summary�items�
ValueError)
�self�namer"�attrs�contextr#�hasher�key�value_�	__class__s
         �rr%z&ReadOnlyPasswordHashWidget.get_context's+����'�'�%�%�d�E�5�9�9�����		M��(�(�)A�B�B�		M��N�N�G�W�-?�%@�%@�A�B�B�B�B�
M�(��/�/��$*�#6�#6�u�#=�#=�#C�#C�#E�#E�M�M�K�C���N�N�W�S�\�\�F�#K�#K�L�L�L�L�M���
l�
l�
l������1h�)i�)i�j�k�k�k�k�k�
l����
%��	���s�)C�.C<�;C<)�__name__�
__module__�__qualname__�
template_name�	read_onlyr%�
__classcell__�r2s@rrr#sB�������?�M��I���������rrc�"��eZdZeZ�fd�Z�xZS)�ReadOnlyPasswordHashFieldc���|�dd��|�dd��t��j|i|��dS)N�requiredF�disabledT)�
setdefaultr$�__init__�r+�args�kwargsr2s   �rr@z"ReadOnlyPasswordHashField.__init__;sQ������*�e�,�,�,����*�d�+�+�+������$�)�&�)�)�)�)�)r)r3r4r5r�widgetr@r8r9s@rr;r;8s=�������
'�F�*�*�*�*�*�*�*�*�*rr;c�(��eZdZ�fd�Z�fd�Z�xZS)�
UsernameFieldc���t���|��}|j�t|��|jkr|St	jd|��S)Nr)r$�	to_python�
max_length�lenrr)r+r"r2s  �rrHzUsernameField.to_pythonBsN������!�!�%�(�(���?�&�3�u�:�:���+G�+G��L��$�V�U�3�3�3rc�T��it���|���ddd��S)N�none�username)�autocapitalize�autocomplete)r$�widget_attrs)r+rDr2s  �rrPzUsernameField.widget_attrsMs<���
��g�g�"�"�6�*�*�
�$�&�
�
�
�	
r)r3r4r5rHrPr8r9s@rrFrFAsQ�������	4�	4�	4�	4�	4�
�
�
�
�
�
�
�
�
rrFc�V��eZdZdZded��iZejed��dejddi���e	j
���	��Zejed
��ejddi���ded�����ZGd
�d��Z
�fd�Zd�Z�fd�Zd�fd�	Z�xZS)�UserCreationFormzc
    A form that creates a user, with no privileges, from the given username and
    password.
    �password_mismatch�'The two password fields didn’t match.�PasswordFrO�new-password�r-)r!�striprD�	help_textzPassword confirmation�4Enter the same password as before, for verification.�r!rDrXrYc��eZdZeZdZdeiZdS)�UserCreationForm.Meta)rMrMN�r3r4r5r	�model�fieldsrF�
field_classes�rr�Metar]js"����������#�]�3�
�
�
rrcc���t��j|i|��|jjj|jvr+d|j|jjjjjd<dSdS)NT�	autofocus)r$r@�_metar_�USERNAME_FIELDr`rDr-rAs   �rr@zUserCreationForm.__init__osa��������$�)�&�)�)�)��:��*�d�k�9�9�UY�D�K��
�(�7�8�?�E�k�R�R�R�:�9rc��|j�d��}|j�d��}|r$|r"||krt|jdd����|S�N�	password1�	password2rS��code)�cleaned_data�getr�error_messages�r+rjrks   r�clean_password2z UserCreationForm.clean_password2tsu���%�)�)�+�6�6�	��%�)�)�+�6�6�	��	��	�y�I�'=�'=�!��#�$7�8�(����
��rc���t�����|j�d��}|rK	t	j||j��dS#t$r!}|�d|��Yd}~dSd}~wwxYwdS)Nrk)	r$�_post_cleanrnror�validate_password�instancer�	add_error)r+�password�errorr2s   �rrtzUserCreationForm._post_clean~s����
���������$�(�(��5�5���	3�
3�#�5�h��
�N�N�N�N�N��"�
3�
3�
3����{�E�2�2�2�2�2�2�2�2�2�����
3����	3�	3s�A�
B�%B�BTc���t���d���}|�|jd��|r|���|S)NF)�commitrj)r$�save�set_passwordrn)r+r{�userr2s   �rr|zUserCreationForm.save�sP����w�w�|�|�5�|�)�)�����$�+�K�8�9�9�9��	��I�I�K�K�K��r�T)r3r4r5�__doc__�_rpr�	CharField�
PasswordInputr�"password_validators_help_text_htmlrjrkrcr@rrrtr|r8r9s@rrRrRUsn���������
	�Q�Q�H�I�I��N� ����a�
�m�m��"�u�"�.�.�)I�J�J�J�H�%�H�J�J�	���I� ����a�'�(�(�"�u�"�.�.�)I�J�J�J���!�J�K�K�	���I�4�4�4�4�4�4�4�4�
Z�Z�Z�Z�Z�
���	3�	3�	3�	3�	3����������rrRc�v��eZdZeed��ed�����ZGd�d��Z�fd�Z�xZS)�UserChangeFormrUu�Raw passwords are not stored, so there is no way to see this user’s password, but you can change the password using <a href="{}">this form</a>.)r!rYc��eZdZeZdZdeiZdS)�UserChangeForm.Meta�__all__rMNr^rbrrrcr��s"����������#�]�3�
�
�
rrcc�*��t��j|i|��|j�d��}|r|j�d��|_|j�d��}|r!|j�d��|_dSdS)Nrxz../password/�user_permissions�content_type)r$r@r`rorY�format�queryset�select_related)r+rBrCrxr�r2s     �rr@zUserChangeForm.__init__�s���������$�)�&�)�)�)��;�?�?�:�.�.���	K�!)�!3�!:�!:�>�!J�!J�H���;�?�?�+=�>�>���	a�(8�(A�(P�(P�Q_�(`�(`��%�%�%�	a�	ar)	r3r4r5r;r�rxrcr@r8r9s@rr�r��s��������(�(��a�
�m�m��!�
*�
�
����H�4�4�4�4�4�4�4�4�
a�a�a�a�a�a�a�a�arr�c���eZdZdZeejddi������Zeje	d��dej
dd	i����
��Ze	d��e	d��d
�Zd�fd�	Z
d�Zd�Zd�Zd�Z�xZS)�AuthenticationFormzs
    Base class for authenticating users. Extend this to get a form that accepts
    username/password logins.
    reTrW)rDrUFrO�current-password�r!rXrDz^Please enter a correct %(username)s and password. Note that both fields may be case-sensitive.zThis account is inactive.)�
invalid_login�inactiveNc���||_d|_t��j|i|��tj�tj��|_|jj	pd}||j
d_	||j
djjd<|j
dj
�+t|jj��|j
d_
dSdS)z�
        The 'request' parameter is set for custom auth use by subclasses.
        The form data comes in via the standard 'data' kwarg.
        N�rM�	maxlength)�request�
user_cacher$r@�	UserModelrf�	get_fieldrg�username_fieldrIr`rDr-r!r�verbose_name)r+r�rBrC�username_max_lengthr2s     �rr@zAuthenticationForm.__init__�s����
�����������$�)�&�)�)�)�(�o�7�7�	�8P�Q�Q���"�1�<�C���-@���J��*�<O���J��&�,�[�9��;�z�"�(�0�,4�T�5H�5U�,V�,V�D�K�
�#�)�)�)�1�0rc�"�|j�d��}|j�d��}|�S|rQt|j||���|_|j�|����|�|j��|jS)NrMrx)rMrx)rnrorr�r��get_invalid_login_error�confirm_login_allowed)r+rMrxs   r�cleanzAuthenticationForm.clean�s����$�(�(��4�4���$�(�(��4�4����H��*�4�<�(�U]�^�^�^�D�O���&��2�2�4�4�4��*�*�4�?�;�;�;�� � rc�L�|jst|jdd����dS)a�
        Controls whether the given User may log in. This is a policy setting,
        independent of end-user authentication. This default behavior is to
        allow login by active users, and reject login by inactive users.

        If the given user cannot log in, this method should raise a
        ``ValidationError``.

        If the given user may log in, this method should return None.
        r�rlN)�	is_activerrp)r+r~s  rr�z(AuthenticationForm.confirm_login_allowed�s=���~�	�!��#�J�/�����
�	�	rc��|jS�N)r��r+s r�get_userzAuthenticationForm.get_user�s
����rc�T�t|jddd|jji���S)Nr�rM)rm�params)rrpr�r�r�s rr�z*AuthenticationForm.get_invalid_login_error�s5������0� ��� 3� @�A�
�
�
�	
rr�)r3r4r5r�rFr�	TextInputrMr�r�r�rxrpr@r�r�r�r�r8r9s@rr�r��s"����������}�O�E�O�;��:M�$N�$N�$N�O�O�O�H��u���a�
�m�m��"�u�"�.�:L�)M�N�N�N����H���
,�
�
��A�1�2�2���N�W�W�W�W�W�W�"!�!�!����"���
�
�
�
�
�
�
rr�c	��eZdZejed��dejddi������Z	dd�Zd	�Z	dd
dde
ddddf	d
�ZdS)�PasswordResetForm�Emailr�rO�emailrW)r!rIrDNc��tj||��}d�|�����}tj||��}t	||||g��}	|�+tj||��}
|	�|
d��	|	���dS#t$r*t�	d|dj
��YdSwxYw)zO
        Send a django.core.mail.EmailMultiAlternatives to `to_email`.
        �Nz	text/htmlz)Failed to send password reset email to %sr~)r�render_to_string�join�
splitlinesr
�attach_alternative�send�	Exception�logger�	exception�pk)r+�subject_template_name�email_template_namer.�
from_email�to_email�html_email_template_name�subject�body�
email_message�
html_emails           r�	send_mailzPasswordResetForm.send_mail�s���
�)�*?��I�I���'�'�'�,�,�.�.�/�/���&�':�G�D�D��.�w��j�8�*�U�U�
�#�/��0�1I�7�S�S�J��,�,�Z��E�E�E�	���� � � � � ���	�	�	����;�W�V�_�=O�
�
�
�
�
�
�	���s�B)�)0C�Cc����t����tjjdid�z�ddi��}��fd�|D��S)aGiven an email, return matching user(s) who should receive a reset.

        This allows subclasses to more easily customize the default policies
        that prevent inactive users and users with unusable passwords from
        resetting their password.
        z
%s__iexactr�Tc3��K�|]8}|����t�t|������4|V��9dSr�)�has_usable_passwordr�getattr)�.0�ur��email_field_names  ��r�	<genexpr>z.PasswordResetForm.get_users.<locals>.<genexpr>!sh�����
�
���$�$�&�&�
�
 ��w�q�2B�'C�'C�D�D�
�
�
�
�
�
�
�
rrb)r��get_email_field_name�_default_manager�filter)r+r��active_usersr�s ` @r�	get_userszPasswordResetForm.get_userss|����%�9�9�;�;�� �1�8����+�+�U���<
����
�
�
�
�
�#�
�
�
�	
rz'registration/password_reset_subject.txtz&registration/password_reset_email.htmlFc
	��|jd}
|st|��}|j}|j}
n|x}}
t���}|�|
��D]q}t||��}||
|tt|j
����||�|��|rdndd�|	pi�}|�||||||����rdS)zf
        Generate a one-use only link for resetting password and send it to the
        user.
        r��https�http)r��domain�	site_name�uidr~�token�protocol)r�N)
rnrr,r�r�r�r�r�rrr��
make_tokenr�)r+�domain_overrider�r��	use_https�token_generatorr�r�r��extra_email_contextr��current_siter�r�r�r~�
user_emailr.s                  rr|zPasswordResetForm.save's���!�'�*���	1�+�G�4�4�L�$�)�I�!�(�F�F�!0�0�I��$�9�9�;�;���N�N�5�)�)�	�	�D� ��'7�8�8�J�#� �&�,�[���-A�-A�B�B��(�3�3�D�9�9�'0�<�G�G�f�	�	�'�,�"�	�G�
�N�N�%�':�G�Z��5M�
�
�
�
�
�	�	rr�)r3r4r5r�
EmailFieldr��
EmailInputr�r�r�r
r|rbrrr�r��s��������E���a��j�j���u��~�w�&?�@�@�@�
�
�
�E�KO�����,
�
�
�$$(�#L�!I��.E��d�T�!%�!�!�!�!�!�!rr�c���eZdZdZded��iZejed��ejddi���de	j
���	��Zejed
��dejddi������Z�fd�Z
d
�Zdd�Z�xZS)�SetPasswordFormza
    A form that lets a user change set their password without entering the old
    password
    rSrTzNew passwordrOrVrWFr[zNew password confirmationr�c�H��||_t��j|i|��dSr��r~r$r@�r+r~rBrCr2s    �rr@zSetPasswordForm.__init___�,�����	������$�)�&�)�)�)�)�)rc���|j�d��}|j�d��}|r$|r"||krt|jdd����t	j||j��|S)N�
new_password1�
new_password2rSrl�rnrorrprrur~rqs   r�clean_new_password2z#SetPasswordForm.clean_new_password2cs����%�)�)�/�:�:�	��%�)�)�/�:�:�	��	��	��I�%�%�%��'�(;�<�,�����	�-�i���C�C�C��rTc��|jd}|j�|��|r|j���|jS)Nr��rnr~r}r|�r+r{rxs   rr|zSetPasswordForm.saveosG���$�_�5���	���x�(�(�(��	��I�N�N�����y�rr)r3r4r5r�r�rprr�r�rr�r�r�r@r�r|r8r9s@rr�r�Ks���������
	�Q�Q�H�I�I��N�$�E�O��a����"�u�"�.�.�)I�J�J�J��H�%�H�J�J�	���M�$�E�O��a�+�,�,��"�u�"�.�.�)I�J�J�J����M�*�*�*�*�*�
�
�
��������rr�c	��eZdZdZiej�ded��i�Zejed��dej	ddd��	���
��Z
gd�Zd�Zd
S)�PasswordChangeFormz[
    A form that lets a user change their password by entering their old
    password.
    �password_incorrectzAYour old password was entered incorrectly. Please enter it again.zOld passwordFr�T�rOrerWr�)�old_passwordr�r�c��|jd}|j�|��st|jdd����|S)zB
        Validate that the old_password field is correct.
        r�r�rl)rnr~�check_passwordrrp)r+r�s  r�clean_old_passwordz%PasswordChangeForm.clean_old_password�sW���(��8���y�'�'��5�5�	�!��#�$8�9�)����
��rN)
r3r4r5r�r�rpr�rr�r�r��field_orderr�rbrrr�r�ws����������
�
(���a�a� c�d�d���N�#�5�?��a�����"�u�"�:L�[_�)`�)`�a�a�a����L�E�D�D�K�
�
�
�
�
rr�c�N��eZdZdZded��iZdZejed��ej	ddd��	��d
e
j�����Zejed��ej	d
di�	��d
ed�����Z
�fd�Zd�Zdd�Ze�fd���Z�xZS)�AdminPasswordChangeFormzN
    A form used to change the password of a user in the admin interface.
    rSrTr=rUrVTr�rWFr[zPassword (again)rOrZc�H��||_t��j|i|��dSr�r�r�s    �rr@z AdminPasswordChangeForm.__init__�r�rc���|j�d��}|j�d��}|r$|r"||krt|jdd����t	j||j��|Srir�rqs   rrrz'AdminPasswordChangeForm.clean_password2�s����%�)�)�+�6�6�	��%�)�)�+�6�6�	��	��	�y�I�'=�'=�!��#�$7�8�(����
�	�-�i���C�C�C��rc��|jd}|j�|��|r|j���|jS)zSave the new password.rjr�r�s   rr|zAdminPasswordChangeForm.save�sG���$�[�1���	���x�(�(�(��	��I�N�N�����y�rc�T��t��j}|jD]
}||vrgcS�dgS)Nrx)r$�changed_datar`)r+�datar,r2s   �rrz$AdminPasswordChangeForm.changed_data�sA����w�w�#���K�	�	�D��4����	�	�	� ��|�rr)r3r4r5r�r�rp�required_css_classrr�r�rr�rjrkr@rrr|�propertyrr8r9s@rr�r��sM���������	�Q�Q�H�I�I��N�$������a�
�m�m�"�u�"�.�W[�)\�)\�]�]�]��H�%�H�J�J�	���I� ����a�"�#�#�"�u�"�.�.�)I�J�J�J���!�J�K�K�	���I�*�*�*�*�*�	�	�	�����������X�����rr�)4�loggingr�djangor�django.contrib.authrrr�django.contrib.auth.hashersrr�django.contrib.auth.modelsr	�django.contrib.auth.tokensr
�django.contrib.sites.shortcutsr�django.core.exceptionsr�django.core.mailr
�django.templater�django.utils.encodingr�django.utils.httpr�django.utils.textr�django.utils.translationrrr�r��	getLoggerr�r�Widgetr�Fieldr;r�rF�	ModelFormrRr��Formr�r�r�r�r�rbrr�<module>rsP����������������������������������,�+�+�+�+�+�>�>�>�>�>�>�;�;�;�;�;�;�2�2�2�2�2�2�3�3�3�3�3�3�"�"�"�"�"�"�-�-�-�-�-�-�3�3�3�3�3�3�&�&�&�&�&�&�?�?�?�?�?�?�?�?��N���	�	��	�0�	1�	1��h�h�h�����������**�*�*�*�*���*�*�*�
�
�
�
�
�E�O�
�
�
�(9�9�9�9�9�u��9�9�9�xa�a�a�a�a�U�_�a�a�a�2K
�K
�K
�K
�K
���K
�K
�K
�\P�P�P�P�P��
�P�P�P�f)�)�)�)�)�e�j�)�)�)�X���������<2�2�2�2�2�e�j�2�2�2�2�2r

Youez - 2016 - github.com/yon3zu
LinuXploit