GRAYBYTE WORDPRESS FILE MANAGER9249

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/cpapi/plugins/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/cpapi/plugins//universal.py
# -*- coding: utf-8 -*-

"""
api that is suitable for both cPanel, Directadmin, interWorx
"""

import socket

from clcommon import mysql_lib


def get_cp_description():
    """
    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
    """
    return None


def _dblogin_cplogin_pairs(access, cplogin_lst=None, dbname='mysql'):
    """
    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:
    """
    dbhost = access.get('host', 'localhost')
    dblogin = access['login']
    dbpass = access['pass']

    sql = r"SELECT User, LEFT(Db, LOCATE('\\', Db) - 1) AS DbPart FROM db WHERE User != '' and Db LIKE '%\\\%'"
    if cplogin_lst:
        joined_cplogin_lst = "', '".join(cplogin_lst)
        sql += rf" and LEFT(Db, LOCATE('\\', Db) - 1) in ('{joined_cplogin_lst}')"
    sql += r" GROUP BY User, DbPart"

    connector = mysql_lib.MySQLConnector(host=dbhost, user=dblogin,
                                         passwd=dbpass, db=dbname)
    with connector.connect() as db:
        return db.execute_query(sql)


def get_admin_email(_hostname=None):
    """
    Gets admin email
    :param str|None _hostname: hostname for testing
    :return: admin's email
    :rtype: string
    """
    return 'root@' + (_hostname or socket.gethostname())


def admins(debug=False):
    """
    List all admins names in given control panel
    :param bool debug: Do produce debug output or don't
    :return: list of strings
    """
    return ["root"]


def is_admin(username):
    """
    Return True if username is in admin names
    :param str username: user to check
    :return: bool
    """
    return username in admins()

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
May 29 2025 08:30:33
root / root
0755
__pycache__
--
May 29 2025 08:30:32
root / root
0755
__init__.py
0.022 KB
May 13 2025 09:56:38
root / root
0644
backward_plugin.py
10.879 KB
May 13 2025 09:56:38
root / root
0644
cpanel.py
41.153 KB
May 13 2025 09:56:38
root / root
0644
directadmin.py
40.319 KB
May 13 2025 09:56:38
root / root
0644
interworx.py
3.68 KB
May 13 2025 09:56:38
root / root
0644
ispmanager.py
9.645 KB
May 13 2025 09:56:38
root / root
0644
nopanel.py
7.727 KB
May 13 2025 09:56:38
root / root
0644
plesk.py
34.817 KB
May 13 2025 09:56:38
root / root
0644
universal.py
1.874 KB
May 13 2025 09:56:38
root / root
0644
vendors.py
11.445 KB
May 13 2025 09:56:38
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF