REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.70 KB
Close
/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/simple_rpc/myimunify.py
Text
Base64
import urllib.parse from typing import List, Optional import defence360agent.subsys.panels.hosting_panel as hp from defence360agent.contracts.config import ( MyImunifyConfig, is_mi_freemium_license, ) from defence360agent.myimunify.model import ( MyImunify, set_protection_status_for_all_users, update_users_protection, ) from defence360agent.rpc_tools import lookup from defence360agent.utils import Scope class MyImunifyEndpoints(lookup.RootEndpoints): SCOPE = Scope.IM360 @lookup.bind("myimunify", "update") async def update(self, items: List[str], protection: str): await update_users_protection( self._sink, items, protection == "enabled" ) return {} @lookup.bind("myimunify", "enable-all") async def enable_all(self): await set_protection_status_for_all_users(self._sink, True) @lookup.bind("myimunify", "disable-all") async def disable_all(self): await set_protection_status_for_all_users(self._sink, False) class MyImunifyCommonEndpoints(lookup.CommonEndpoints): SCOPE = Scope.IM360 @lookup.bind("myimunify", "status") async def status(self, items: List[str], user: Optional[str] = None): purchase_url = MyImunifyConfig.PURCHASE_PAGE_URL panel_manager = hp.HostingPanel() if user is not None: items = [user] # if MY_IMNUNIFY is disabled, we don't need to generate purchase # url with domain and ip [because it will not been shown to user] if MyImunifyConfig.ENABLED: user_domains = ( await panel_manager.get_domains_per_user() ).get(user, []) domain = next(iter(user_domains), None) purchase_url = ( MyImunifyConfig.PURCHASE_PAGE_URL + "/?" + urllib.parse.urlencode( { "m": "cloudlinux_advantage", "action": "provisioning", "suite": "my_imunify_account_protection", "username": user, "domain": domain, "server_ip": panel_manager.get_server_ip(), } ) ) response = MyImunify.select().where(MyImunify.user.in_(items)).dicts() return { "myimunify_enabled": MyImunifyConfig.ENABLED, "purchase_page_url": purchase_url, "is_freemium": is_mi_freemium_license(), "items": [ {"username": item["user"], "protection": item["protection"]} for item in response ], }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 3 × Files: 13
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
schema
DIR
-
drwxr-xr-x
2026-06-08 20:24:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
schema_responses
DIR
-
drwxr-xr-x
2026-06-08 20:24:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__pycache__
DIR
-
drwxr-xr-x
2026-06-08 20:24:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
advisor.py
1.49 KB
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
analyst_cleanup.py
7.07 KB
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
endpoints.py
11.05 KB
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
hooks.py
2.82 KB
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
hosting_panel.py
1.47 KB
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
myimunify.py
2.70 KB
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
permissions.py
317 B
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
plesk_stats.py
4.32 KB
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
reputation_management.py
1.95 KB
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
schema.py
7.06 KB
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
wordpress_security_plugin.py
6.77 KB
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
wp_disabled_rules.py
10.09 KB
lrw-r--r--
2026-05-26 21:20:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
15.72 KB
lrw-r--r--
2026-05-26 21:20:45
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).