GRAYBYTE WORDPRESS FILE MANAGER8645

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
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/bin/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/cloudlinux/venv/bin//clcpapi
#!/opt/cloudlinux/venv/bin/python3 -bb
# -*- coding: utf-8 -*-

# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2018 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT

"""
CloudLinux control panel API command line interface
"""

import argparse
from clcommon import cpapi
from clcommon.cloutput import prepare_data_json, prepare_attention_json
from clcommon.cpapi import cpapiexceptions


def cpapi_parser():

    parser = argparse.ArgumentParser(description="%(prog)s - CloudLinux control panel API command line interface")
    parser.add_argument('-j', '--json', action='store_true', default=False, help='Output in json format')
    subparsers = parser.add_subparsers(dest='command')

    docroot_parser = subparsers.add_parser('docroot')
    docroot_parser.add_argument('domain', help='Return document root for domain')

    userdomains_parser = subparsers.add_parser('userdomains')
    userdomains_parser.add_argument('userdomains', help='Return domain and document root pairs for control panel user')

    dblogin_cplogin_pairs_parser = subparsers.add_parser("dblogin_cplogin_pairs")
    dblogin_cplogin_pairs_parser.add_argument("--cplogin_lst", nargs="*",
                                  help="Return mapping for this system users")
    dblogin_cplogin_pairs_parser.add_argument("--with_system_users", action="store_true", default=False,
                                  help="Show system users in output")
    reseller_users = subparsers.add_parser("reseller-users",
                                  help="Show reseller users")
    reseller_users.add_argument(
        'resellername', type=str, nargs='?',
        help='Reseller name')
    return parser


def flat_plain(data, sep=' '):
    return '\n'.join([sep.join(tuple_) for tuple_ in data])


def main():
    parser = cpapi_parser()
    namespace = parser.parse_args()
    output_ = None
    exit_code = 0
    try:
        if namespace.command == 'docroot':
            domain, user = cpapi.docroot(namespace.domain)
            if namespace.json:
                output_ = prepare_data_json({'domain': domain, 'user': user})
            else:
                output_ = domain + ' ' + user
        elif namespace.command == 'userdomains':
            domain_docroot_pairs = cpapi.userdomains(namespace.userdomains)
            if namespace.json:
                data = [{'domain': domain_docroot[0],
                         'docroot': domain_docroot[1]}
                        for domain_docroot in domain_docroot_pairs]
                output_ = prepare_data_json(data)
            else:
                output_ = flat_plain(domain_docroot_pairs)
        elif namespace.command == 'dblogin_cplogin_pairs':
            db_mapping = cpapi.dblogin_cplogin_pairs(namespace.cplogin_lst,
                                                     namespace.with_system_users)
            if namespace.json:
                output_ = prepare_data_json(db_mapping)
            else:
                output_ = flat_plain(db_mapping)
        elif namespace.command == 'reseller-users':
            users = cpapi.reseller_users(namespace.resellername)
            if namespace.json:
                output_ = prepare_data_json(users)
            else:
                output_ = '\n'.join(users)

    except cpapiexceptions.CPAPIException as e_:
        if namespace.json:
            output_ = prepare_attention_json(str(e_))
        else:
            exit_code = 1
            output_ = 'ERROR: ' + str(e_)
    return output_, exit_code


if __name__ == '__main__':
    import sys
    output_, exit_code = main()
    if output_:
        print(output_)
    if exit_code:
        sys.exit(exit_code)

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
May 15 2025 08:30:34
root / root
0755
Activate.ps1
8.821 KB
April 17 2025 13:10:59
root / root
0644
activate
1.651 KB
April 17 2025 13:10:59
root / root
0644
activate.csh
0.894 KB
April 17 2025 13:10:59
root / root
0644
activate.fish
2.14 KB
April 17 2025 13:10:59
root / root
0644
alembic
0.224 KB
April 17 2025 13:10:59
root / root
0755
chardetect
0.231 KB
April 17 2025 13:10:59
root / root
0755
cl_sysctl
4.512 KB
May 13 2025 09:56:38
root / root
0755
clcpapi
3.643 KB
May 13 2025 09:56:38
root / root
0755
coverage
0.226 KB
April 17 2025 13:10:59
root / root
0755
coverage-3.11
0.226 KB
April 17 2025 13:10:59
root / root
0755
coverage3
0.226 KB
April 17 2025 13:10:59
root / root
0755
cpanel-dbmapping
3.833 KB
May 13 2025 09:56:38
root / root
0755
da_suid_caller.py
0.67 KB
May 13 2025 09:56:38
root / root
0644
detect-requirements
0.232 KB
April 17 2025 13:10:59
root / root
0755
dodgy
0.219 KB
April 17 2025 13:10:59
root / root
0755
epylint
0.229 KB
April 17 2025 13:10:59
root / root
0755
f2py
0.227 KB
April 17 2025 13:10:59
root / root
0755
f2py3
0.227 KB
April 17 2025 13:10:59
root / root
0755
f2py3.11
0.227 KB
April 17 2025 13:10:59
root / root
0755
flake8
0.225 KB
April 17 2025 13:10:59
root / root
0755
futurize
0.226 KB
April 17 2025 13:10:59
root / root
0755
get_gprof
1.841 KB
April 17 2025 13:10:59
root / root
0755
get_objgraph
1.628 KB
April 17 2025 13:10:59
root / root
0755
isort
0.22 KB
April 17 2025 13:10:59
root / root
0755
isort-identify-imports
0.253 KB
April 17 2025 13:10:59
root / root
0755
jsonschema
0.224 KB
April 17 2025 13:10:59
root / root
0755
lvestats_config_reader.py
1.118 KB
May 30 2025 10:30:47
root / root
0644
mako-render
0.224 KB
April 17 2025 13:10:59
root / root
0755
normalizer
0.254 KB
April 17 2025 13:10:59
root / root
0755
pasteurize
0.228 KB
April 17 2025 13:10:59
root / root
0755
pip
0.231 KB
April 17 2025 13:10:59
root / root
0755
pip3
0.231 KB
April 17 2025 13:10:59
root / root
0755
pip3.11
0.231 KB
April 17 2025 13:10:59
root / root
0755
plesk_suid_caller.py
0.884 KB
May 13 2025 09:56:38
root / root
0644
prospector
0.224 KB
April 17 2025 13:10:59
root / root
0755
py.test
0.231 KB
April 17 2025 13:10:59
root / root
0755
pycodestyle
0.223 KB
April 17 2025 13:10:59
root / root
0755
pydocstyle
0.224 KB
April 17 2025 13:10:59
root / root
0755
pyflakes
0.222 KB
April 17 2025 13:10:59
root / root
0755
pylint
0.228 KB
April 17 2025 13:10:59
root / root
0755
pylint-config
0.243 KB
April 17 2025 13:10:59
root / root
0755
pyreverse
0.233 KB
April 17 2025 13:10:59
root / root
0755
pysemver
0.22 KB
April 17 2025 13:10:59
root / root
0755
pytest
0.231 KB
April 17 2025 13:10:59
root / root
0755
python
15.586 KB
April 25 2025 15:37:08
root / linksafe
0755
python3
15.586 KB
April 25 2025 15:37:08
root / linksafe
0755
python3.11
15.586 KB
April 25 2025 15:37:08
root / linksafe
0755
raven
0.229 KB
April 17 2025 13:10:59
root / root
0755
symilar
0.229 KB
April 17 2025 13:10:59
root / root
0755
tap
0.218 KB
April 17 2025 13:10:59
root / root
0755
tappy
0.218 KB
April 17 2025 13:10:59
root / root
0755
undill
0.589 KB
April 17 2025 13:10:59
root / root
0755
virtualenv
0.248 KB
April 17 2025 13:10:59
root / root
0755

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF