REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.84 KB
Close
//proc/self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/public_hooks/README.md
Text
Base64
#Description All hooks in the new system are grouped by objects that this event affects. Those, create one hook to change a domain (any!), another to change a user. Each hook must have a formal description of the available methods that you can subscribe to. Example: class ModifyUserHook(object): HOOK_VERSION = 1 @hook_method def pre_create_user(self, username, owner, **kwargs): pass @hook_method def post_create_user(self, username, owner, **kwargs): pass @hook_method def pre_rename_user(self, username, new_name, **kwargs): pass @hook_method def post_rename_user(self, username, new_name, **kwargs): pass It is proposed to form methods according to the template: def [post|pre]_(action)_(object)(self, arg1, arg2, **kwargs): To create a new panel event listener, you need to create a .py file in the folder `/usr/share/cloudlinux/hooks/listeners/`. In that file, you should create class that inherits from one (or several!) of universal hooks, and the required methods must be redefined. #!/opt/cloudlinux/venv/bin/python3 # coding=utf-8 import subprocess import sys from clcommon.public_hooks.lib import ModifyUserHook, ModifyDomainHook class SyncMapHook(ModifyUserHook, ModifyDomainHook): @staticmethod def call_sync_map(): # no matter def post_create_user(self, username, owner, **kwargs): self.call_sync_map() def post_delete_user(self, username, **kwargs): self.call_sync_map() def post_transit_user(self, username, new_name, **kwargs): self.call_sync_map() In the example above, we subscribe to three events: - post_create_user; - post_delete_user; - post_transit_user. See detailed description in userland docs.
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 5 × Files: 2
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
bin
DIR
-
drwxr-xr-x
2026-04-30 07:09:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
bundle
DIR
-
drwxr-xr-x
2026-04-30 07:09:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
configs
DIR
-
drwxr-xr-x
2026-04-30 07:09:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
lib
DIR
-
drwxr-xr-x
2026-04-30 07:09:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__pycache__
DIR
-
drwxr-xr-x
2026-04-30 07:09:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
README.md
1.84 KB
lrw-r--r--
2026-04-03 15:53:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
2.50 KB
lrw-r--r--
2026-04-03 15:53:36
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).