<?php
if (!defined('ABSPATH')) exit;

/**
 * Centralized alarm type constants
 * Accessible from all client files (qtrBruteForce, qtrLoginSecurity, etc.)
 * and the alarm factory (qtrAlarmFactory)
 */
class CQtrAlarmTypes
{
    // Brute Force Alarms
    const TYPE_BRUTE_FORCE_BLACKLIST = 'brute_force.blacklist';
    const TYPE_BRUTE_FORCE_IP_LOCK = 'brute_force.ip_lock';
    const TYPE_BRUTE_FORCE_COMBO_LOCK = 'brute_force.combo_lock';
    const TYPE_BRUTE_FORCE_SOFT_LOCK = 'brute_force.soft_lock';
    const TYPE_BRUTE_FORCE_HARD_LOCK = 'brute_force.hard_lock';
    const TYPE_BRUTE_FORCE_SPRAY = 'brute_force.spray';
    const TYPE_BRUTE_FORCE_UNLOCK_SENT = 'brute_force.unlock_sent';
    const TYPE_ADMIN_ACCOUNT_LOCKED = 'admin.account_locked';

    // Login Security Alarms
    const TYPE_LOGIN_FAILED = 'login.failed';
    const TYPE_LOGIN_FAILED_WARNING = 'login.failed.warning';
    const TYPE_LOGIN_FAILED_CRITICAL = 'login.failed.critical';
    const TYPE_LOGIN_FAILED_SUMMARY = 'login.failed.summary';
    const TYPE_LOGIN_SUCCESS = 'login.success';

    // Admin Monitoring Alarms
    const TYPE_ADMIN_ADDED = 'admin.added';
    const TYPE_ADMIN_REMOVED = 'admin.removed';
    const TYPE_ADMIN_ROLE_CHANGED = 'admin.role_changed';

    // Bot Protection Alarms
    const TYPE_BOT_BLOCK = 'bot.block';

    /**
     * Get all alarm types
     * @return array List of all available alarm type constants
     */
    public static function get_all_types()
    {
        return array(
            self::TYPE_BRUTE_FORCE_BLACKLIST,
            self::TYPE_BRUTE_FORCE_IP_LOCK,
            self::TYPE_BRUTE_FORCE_COMBO_LOCK,
            self::TYPE_BRUTE_FORCE_SOFT_LOCK,
            self::TYPE_BRUTE_FORCE_HARD_LOCK,
            self::TYPE_BRUTE_FORCE_SPRAY,
            self::TYPE_BRUTE_FORCE_UNLOCK_SENT,
            self::TYPE_ADMIN_ACCOUNT_LOCKED,
            self::TYPE_LOGIN_FAILED,
            self::TYPE_LOGIN_FAILED_WARNING,
            self::TYPE_LOGIN_FAILED_CRITICAL,
            self::TYPE_LOGIN_FAILED_SUMMARY,
            self::TYPE_LOGIN_SUCCESS,
            self::TYPE_ADMIN_ADDED,
            self::TYPE_ADMIN_REMOVED,
            self::TYPE_ADMIN_ROLE_CHANGED,
            self::TYPE_BOT_BLOCK,
        );
    }
}
