$13 GRAYBYTE WORDPRESS FILE MANAGER $72

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/model/

HOME
Current File : /opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/model//event_hook.py
from time import time

from peewee import CharField, IntegerField, BooleanField

from defence360agent.model import instance, Model
from defence360agent.model.simplification import FilenameField


class EventHook(Model):
    """Imunify Hooks v1.0 configuration.

    .. deprecated:: 4.10 A new notification system was implemented in DEF-11680
    """

    class Meta:
        database = instance.db
        db_table = "event_hook"

    #: The path to the hook script.
    path = FilenameField(null=False)
    #: The event for which it should trigger.
    event = CharField(null=False)
    #: Timestamp when the hook was added.
    created = IntegerField(null=False, default=lambda: int(time()))
    #: Native hooks can be imported and executed as Python directly, without
    #: creating a separate process.
    native = BooleanField(default=False)

    @classmethod
    def list_events(cls, event):
        q = cls.select()
        if event != "all":
            q = q.where(cls.event == event)
        return list(q.dicts())

    @classmethod
    def add_hook(cls, event, path, native=False):
        q = cls.select().where((cls.event == event) & (cls.path == path))
        if q.exists():
            return None
        hook = cls.create(event=event, path=path, native=native)
        return hook.as_dict()

    @classmethod
    def delete_hook(cls, event, path):
        q = cls.select().where((cls.event == event) & (cls.path == path))
        if not q.exists():
            return None
        hook = q.get()
        data = hook.as_dict()
        hook.delete_instance()
        return data

    def as_dict(self):
        return {
            "path": self.path,
            "event": self.event,
            "created": self.created,
            "native": self.native,
        }


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2026 8.45 AM
root / root
0755
__pycache__
--
3 Mar 2026 8.45 AM
root / root
0755
__init__.py
0.94 KB
23 Jan 2026 1.13 PM
root / root
0644
analyst_cleanup.py
3.401 KB
23 Jan 2026 1.13 PM
root / root
0644
event_hook.py
1.741 KB
23 Jan 2026 1.13 PM
root / root
0644
icontact.py
1.155 KB
23 Jan 2026 1.13 PM
root / root
0644
infected_domain.py
4.236 KB
23 Jan 2026 1.13 PM
root / root
0644
instance.py
0.523 KB
23 Jan 2026 1.13 PM
root / root
0644
messages_to_send.py
1.371 KB
23 Jan 2026 1.13 PM
root / root
0644
simplification.py
5.013 KB
23 Jan 2026 1.13 PM
root / root
0644
tls_check.py
1.289 KB
23 Jan 2026 1.13 PM
root / root
0644
wordpress_incident.py
13.016 KB
23 Jan 2026 1.13 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF