관리-도구
편집 파일: awp_provision_api.cpython-311.pyc
� b��f� � �� � d dl Z d dlZd dlZd dlZd dlmZ d dlmZmZ d dl m Z d dlmZ d dlm Z d dlmZmZ d dlmZ d d lmZ d dlmZ d dlmZ d d lmZmZ d dlmZ d dlm Z defd�Z! G d� d� � Z"dS )� N)�Any)�Schema�SchemaError)�wraps)�Callable)�get_user_auth_key)�userdomains�cpusers)� find_wp_paths)�gettext� )� get_client)�pullzone_info_schema)�XRayAPIError� XRayError)� timestamp)�get_xray_exec_user�funcc � � �� dt dt dt dt fd��t � � � � �fd�� � }|S )N� account_id�domain�website�usernamec �< � t � � }|r|}nU|sSt t � � � � D ]}t |� � }|| k r|} n�t t d� � � � �t |� � }|D ]�}|d |� dd� � � dd� � k rQt t |d � � � � } |� dd� � } | | vrt d| � �� � � d S ��t t d � � � � �)z1 If user owns domain and website z;Passed account_id does not belong to any user on the serverr zhttps://� zhttp://� �/z(Passed website is not found, all sites: z5Passed domain cannot be found in list of user domainsN) r �listr r r �_r �replacer )r r r r � proxy_user�user�auth_key�domains_docroot_list�domain_item�wordpress_list�wp_sites �U/opt/cloudlinux/venv/lib64/python3.11/site-packages/xray/adviser/awp_provision_api.py�validatez%validate_users_data.<locals>.validate sH � � (�)�)� � � f�!�H�H� � f� ����O�O� f� f�D�0��6�6�H��:�-�-�#'���� .� $�A�&c�$d�$d�e�e�e�*�8�4�4��/� X� X�K��1�~���� �B�!?�!?�!G�!G� �SU�!V�!V�V�V�!%�m�K��N�&C�&C�!D�!D��!�/�/�#�r�2�2���.�0�0�#�$_�~�$_�$_�`�`�`���� W� �A�U�V�V�W�W�W� c � �� |� d� � }|� d� � } �||d |d |� � �| i |��}|S )Nr r r r )�get)�args�kwargsr r �responser r) s ��r( �wrapperz$validate_users_data.<locals>.wrapper>