관리-도구
편집 파일: universal.cpython-311.pyc
� P�Cg � �B � d Z ddlZddlmZ d� Zdd�Zdd�Zd d �Zd � ZdS )z> api that is suitable for both cPanel, Directadmin, interWorx � N)� mysql_libc � � dS )z� Retrieve panel name and it's version :return: dict: { 'CPName': 'panel_name', 'CPVer': 'panel_version', 'CPAdd': 'add_info'} or None if can't get info N� r � ��/builddir/build/BUILDROOT/alt-python27-cllib-3.4.17-1.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/cpapi/plugins/universal.py�get_cp_descriptionr s � � �4r �mysqlc �R � | � dd� � }| d }| d }d}|rd� |� � }|d|� d�z }|d z }t j ||||� � � }|� � � 5 } | � |� � cddd� � S # 1 swxY w Y dS )z� Extracting database login control panel login pairs from mysql database supported for cPanel, interWorx, Directadmin :param dblogin: :param dbpass: :param dbhost: :param dbname: :param cplogin_lst: :return: �host� localhost�login�passzbSELECT User, LEFT(Db, LOCATE('\\', Db) - 1) AS DbPart FROM db WHERE User != '' and Db LIKE '%\\\%'z', 'z) and LEFT(Db, LOCATE('\\', Db) - 1) in ('z')z GROUP BY User, DbPart)r �user�passwd�dbN)�get�joinr �MySQLConnector�connect� execute_query) �access�cplogin_lst�dbname�dbhost�dblogin�dbpass�sql�joined_cplogin_lst� connectorr s r �_dblogin_cplogin_pairsr s � � �Z�Z��� ,� ,�F��W�o�G� �F�^�F� o�C�� S�#�[�[��5�5���R�<N�R�R�R�R���$�$�C��(�f�7�06�6�C� C� C�I� � � � � � %������$�$�%� %� %� %� %� %� %� %� %� %� %� %���� %� %� %� %� %� %s �:B�B �#B c �2 � d| pt j � � z S )z| Gets admin email :param str|None _hostname: hostname for testing :return: admin's email :rtype: string zroot@)�socket�gethostname)� _hostnames r �get_admin_emailr% 0 s � � �i�7�6�#5�#7�#7�8�8r Fc � � dgS )z� List all admins names in given control panel :param bool debug: Do produce debug output or don't :return: list of strings �rootr )�debugs r �adminsr) : s � � �8�Or c �"