📁 File Manager Pro
v10.0.2 | PHP: 8.1.34
Server: LiteSpeed
2026-06-29 07:04:29
📂
/
/
opt
/
imunify360
/
venv
/
lib
/
python3.11
/
site-packages
/
defence360agent
/
feature_management
/
__pycache__
✏️
Editing: hooks.cpython-311.opt-1.pyc
� �j� � �& � d Z ddlZddlZddlmZmZmZ ddlmZ ddl m Z mZmZm Z ej e� � Zd� Zd� Zedee d ed efd�� � ZedediZedee d ed efd �� � Ze ee eiZded eee egef fd�ZdS )a This module contains hook, which are called on feature management permission changes. Note that hooks are not executed automatically, developer is responsible to obtain specific hook using get_hook() function and call it. To add hook, create function with name equal to feature name � N)�Any�Callable�Optional)� ConfigFile)�AV�FULL�LOG� PROACTIVEc � � dS )NT� )�_s �]/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/feature_management/hooks.py� _hook_stubr s � ��4� c �F � � t j � � � � fd�� � }|S )Nc �h �� �| |� � }|p!t � d�j || � � |S )Nz#Hook '%s(%s)' failed for user '%s'.)�logger�warning�__name__)�user�value�result�callbacks �r �wrapz_result_warn.<locals>.wrap sC �� ���$��&�&��� �&�.�.�1����� � �� � r )� functools�wraps)r r s ` r �_result_warnr s8 �� ��_�X���� � � � ��� �Kr r r �returnc �p � | sdS t � � }|� dd� � }t | � � }|� dd� � }|t k rd}n0|r.|� d� � r|r|� d� � rd} |� dd|� � n# t $ r Y dS w xY wdS )z#Called when 'av' feature is changedT�MALWARE_SCANNING�default_actionN�cleanup�notifyF)r �getr � startswith�set� Exception)r r �config�config_value�user_config�user_config_values r � antivirusr, ) s � � � ��t� �\�\�F��:�:�0�2B�C�C�L��T�"�"�K�#���(:�<L�M�M����}�}� ����%��(�(��3�3�%� �%� �#�#�I�.�.� %� %������� 0�2C� � � � �� � � � ��u�u����� �4s � B% �% B3�2B3r c � � | sdS t � |d� � } t | � � � dd|� � n# t $ r Y dS w xY wdS )z*Called when 'proactive' feature is changedT�DISABLED�PROACTIVE_DEFENCE�modeF)�_PROACTIVE_MODE_BY_PERMISSIONr$ r r&