MOON
Server: Apache
System: Linux server30c.hostingraja.org 3.10.0-962.3.2.lve1.5.63.el7.x86_64 #1 SMP Fri Oct 8 12:03:35 UTC 2021 x86_64
User: jibhires (1887)
PHP: 8.1.30
Disabled: show_source, system, shell_exec, passthru, exec, popen, proc_open, allow_url_fopen, symlink, escapeshellcmd, pcntl_exec
Upload Files
File: //opt/imunify360/venv/lib/python3.11/site-packages/im360/simple_rpc/hosting_panel.py
from defence360agent.rpc_tools import ValidationError
from defence360agent.rpc_tools.lookup import RootEndpoints, bind
from defence360agent.subsys.panels.base import PanelException
from defence360agent.utils import Scope
from im360.subsys.panels import hosting_panel
from im360.subsys.panels.base import use_modsec_lock
from im360.simple_rpc.unavailable_on_freemium import unavailable_on_freemium


class HostingPanelEndpoints(RootEndpoints):
    SCOPE = Scope.IM360

    @bind("install-vendors")
    @unavailable_on_freemium
    @use_modsec_lock
    async def install_vendors(self):
        try:
            return await self.hosting_panel.install_settings()
        except PanelException as e:
            raise ValidationError(str(e))

    @bind("uninstall-vendors")
    @use_modsec_lock
    async def uninstall_vendors(self):
        try:
            return await self.hosting_panel.revert_settings()
        except PanelException as e:
            raise ValidationError(str(e))

    @bind("admin-emails")
    async def get_admin_emails(self):
        return await self.hosting_panel.get_admin_emails()

    @property
    def hosting_panel(self):
        try:
            return hosting_panel.HostingPanel()
        except PanelException as e:
            raise ValidationError(str(e))