관리-도구
편집 파일: lib.cpython-311.pyc
� \�Dg� � � � d dl Z d dlZd dlZd dlmZ d dlmZmZmZm Z d dl mZmZm Z dZ ej e� � Zdd�Zdd�Zdd�Zdd �Zd � ZdS ) � N)�getpwnam)�cpinfo�userdomains�get_main_username_by_uid�docroot)�POST_MODIFY_USER�POST_MODIFY_DOMAIN�POST_MODIFY_PACKAGEz/etc/psa/psa.confc � � t |� � \ }}t j |� � j }t |� � }|dk rt d|� �� � �t dd|d| g}| |k r|d|gz }t j |� � S )z+ Triggered after any domain change zN/Azgetpwuid(): uid not found: �modify� --username�--domainz--new-domain) r �os�stat�st_uidr �KeyErrorr � subprocess�call)�old_domain_name�new_domain_name�domain_path�_�uid�system_user�argss ��/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/clcommon/public_hooks/bundle/plesk/lib.py�domain_updatedr s� � � �_�-�-�N�K�� �'�+� � � %�C�*�3�/�/�K��e����:�S�:�:�;�;�;� �H��k�:��@�D� �/�)�)����1�1���?�4� � � � c �n � | r|st � d� � dS t t | � � � � }|dk r<t | d�� � d d }t j t dd| d|g� � S |dk rt j t dd| d |g� � S t d | � d�� � �)z� Triggered after creation new subscription in Plesk. This function is called in two situations: - when user with main domain is created - and when additional domain created zFph_created but NEW_SYSTEM_USER or NEW_DOMAIN_NAME is empty, do nothingr � )�reseller)�cpuser�keyls�creater z--ownerr zuser z does not own any domains!) �logger�warning�lenr r r r r r � ValueError)�new_system_userr �number_of_owned_domains�owners r �physical_hosting_createdr, ( s� � � � �/� ����_�`�`�`��q�!�+�o�">�">�?�?���!�#�#��o�^�D�D�D�Q�G��J�����h��/�9�e� =� >� >� >� !�1� $� $������/�:�� H� I� I� I� �L��L�L�L�M�M�Mr c � � | r|st � d� � dS t | � � t j t dd| d|g� � S # t $ r t j t dd| g� � cY S w xY w)a Triggered after deletion physical hosting in Plesk. - means deletion of physical hosting on server (BUT NOT DOMAIN ITSELF -> domain can e.g. forward something) - when there are no more domains owned by system user -> unix user is destroyed here zFph_deleted but OLD_SYSTEM_USER or OLD_DOMAIN_NAME is empty, do nothingr �deleter r )r% r&