[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: additional_hooks.py
File is not writable. Editing disabled.
#!/opt/alt/python37/bin/python3.7 -bb # coding:utf-8 # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2021 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT from __future__ import absolute_import import sys from clcommon.public_hooks.bundle import install_hooks, remove_hooks from clcommon.public_hooks.bundle.cpanel import Hook as cpanel_hook from clcommon.public_hooks import setup_logger_and_sentry from cldetectlib import is_cpanel _BASE_DIR = '/usr/share/cloudlinux/wpos' def hooks(): """ Define list of hooks per panel """ if is_cpanel(): _ADMIN_HOOK = _BASE_DIR + '/cpanel/admin_disable_caching.py' _USER_HOOK = _BASE_DIR + '/cpanel/user_disable_caching.py' _HOOKS = [ cpanel_hook(_ADMIN_HOOK, 'Whostmgr', 'Lang::PHP::set_vhost_versions', 'pre'), cpanel_hook(_ADMIN_HOOK, 'Whostmgr', 'Lang::PHP::set_vhost_versions', 'post'), cpanel_hook(_USER_HOOK, 'Cpanel', 'UAPI::LangPHP::php_set_vhost_versions', 'pre'), cpanel_hook(_USER_HOOK, 'Cpanel', 'UAPI::LangPHP::php_set_vhost_versions', 'post'), ] else: _HOOKS = list() return _HOOKS def main(argv): """ Install or delete cpanel event hook """ success = True _hooks = hooks() if _hooks: if "-i" in argv: success = install_hooks(_hooks) elif "-d" in argv: success = remove_hooks(_hooks) else: success = False return int(not success) if "__main__" == __name__: # in fact this is only wrapper for # hooks logic located in cllib # so we can just use cllib sentry here setup_logger_and_sentry() sys.exit(main(sys.argv[1:]))
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 691.03 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A