REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.87 KB
Close
//opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/cpapi/plugins/universal.py
Text
Base64
# -*- 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()
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 10
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-03-14 07:01:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
backward_plugin.py
10.87 KB
lrw-r--r--
2026-02-10 15:06:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
cpanel.py
41.19 KB
lrw-r--r--
2026-02-10 15:06:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
directadmin.py
40.74 KB
lrw-r--r--
2026-02-10 15:06:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
interworx.py
3.67 KB
lrw-r--r--
2026-02-10 15:06:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ispmanager.py
9.64 KB
lrw-r--r--
2026-02-10 15:06:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
nopanel.py
7.75 KB
lrw-r--r--
2026-02-10 15:06:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
plesk.py
34.97 KB
lrw-r--r--
2026-02-10 15:06:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
universal.py
1.87 KB
lrw-r--r--
2026-02-10 15:06:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
vendors.py
11.57 KB
lrw-r--r--
2026-02-10 15:06:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
23 B
lrw-r--r--
2026-02-10 15:06:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).