Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
AdminLogType
n/a
0 / 0
n/a
0 / 0
0
n/a
0 / 0
1<?php
2
3/**
4 * Admin log type enum
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public License,
7 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
8 * obtain one at https://mozilla.org/MPL/2.0/.
9 *
10 * @package   phpMyFAQ
11 * @author    Thorsten Rinne <thorsten@phpmyfaq.de>
12 * @copyright 2026 phpMyFAQ Team
13 * @license   https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
14 * @link      https://www.phpmyfaq.de
15 * @since     2026-01-04
16 */
17
18declare(strict_types=1);
19
20namespace phpMyFAQ\Enums;
21
22/* @mago-expect lint:too-many-enum-cases - one case per auditable admin action by design */
23enum AdminLogType: string
24{
25    // Backup operations
26    case BACKUP_EXPORT = 'backup-export';
27    case BACKUP_RESTORE = 'backup-restore';
28
29    // FAQ operations
30    case FAQ_ADD = 'faq-add';
31    case FAQ_EDIT = 'faq-edit';
32    case FAQ_COPY = 'faq-copy';
33    case FAQ_TRANSLATE = 'faq-translate';
34    case FAQ_ANSWER_ADD = 'faq-answer-add';
35    case FAQ_DELETE = 'faq-delete';
36    case FAQ_PUBLISH = 'faq-publish';
37
38    // Category operations
39    case CATEGORY_ADD = 'category-add';
40    case CATEGORY_EDIT = 'category-edit';
41    case CATEGORY_DELETE = 'category-delete';
42    case CATEGORY_REORDER = 'category-reorder';
43    case CATEGORY_TRANSLATE = 'category-translate';
44
45    // Comments
46    case COMMENT_DELETE = 'comment-delete';
47
48    // Attachments
49    case ATTACHMENT_ADD = 'attachment-add';
50    case ATTACHMENT_DELETE = 'attachment-delete';
51
52    // News
53    case NEWS_ADD = 'news-add';
54    case NEWS_EDIT = 'news-edit';
55    case NEWS_DELETE = 'news-delete';
56    case NEWS_TRANSLATE = 'news-translate';
57
58    // Custom Pages
59    case PAGE_ADD = 'page-add';
60    case PAGE_EDIT = 'page-edit';
61    case PAGE_DELETE = 'page-delete';
62    case PAGE_TRANSLATE = 'page-translate';
63
64    // Configuration
65    case CONFIG_CHANGE = 'config-change';
66    case CONFIG_SECURITY_CHANGED = 'config-security-changed';
67    case CONFIG_LDAP_CHANGED = 'config-ldap-changed';
68    case CONFIG_SSO_CHANGED = 'config-sso-changed';
69    case CONFIG_ENCRYPTION_CHANGED = 'config-encryption-changed';
70
71    // User management
72    case USER_ADD = 'user-add';
73    case USER_EDIT = 'user-edit';
74    case USER_DELETE = 'user-delete';
75    case USER_CHANGE_PASSWORD = 'user-change-password';
76    case USER_CHANGE_PERMISSIONS = 'user-change-permissions';
77    case USER_PASSWORD_RESET_REQUESTED = 'user-password-reset-requested';
78    case USER_PASSWORD_RESET_COMPLETED = 'user-password-reset-completed';
79    case USER_STATUS_CHANGED = 'user-status-changed';
80    case USER_SUPERADMIN_GRANTED = 'user-superadmin-granted';
81    case USER_SUPERADMIN_REVOKED = 'user-superadmin-revoked';
82
83    // Group management
84    case GROUP_ADD = 'group-add';
85    case GROUP_EDIT = 'group-edit';
86    case GROUP_DELETE = 'group-delete';
87    case GROUP_CHANGE_PERMISSIONS = 'group-change-permissions';
88
89    // Authentication & Authorization
90    case AUTH_LOGIN_SUCCESS = 'auth-login-success';
91    case AUTH_LOGIN_FAILED = 'auth-login-failed';
92    case AUTH_LOGOUT = 'auth-logout';
93    case AUTH_SESSION_TIMEOUT = 'auth-session-timeout';
94    case AUTH_SESSION_TERMINATED = 'auth-session-terminated';
95
96    // Two-Factor Authentication
97    case AUTH_2FA_ENABLED = 'auth-2fa-enabled';
98    case AUTH_2FA_DISABLED = 'auth-2fa-disabled';
99    case AUTH_2FA_SUCCESS = 'auth-2fa-success';
100    case AUTH_2FA_FAILED = 'auth-2fa-failed';
101    case AUTH_2FA_RESET = 'auth-2fa-reset';
102
103    // WebAuthn
104    case AUTH_WEBAUTHN_REGISTER = 'auth-webauthn-register';
105    case AUTH_WEBAUTHN_LOGIN_SUCCESS = 'auth-webauthn-login-success';
106    case AUTH_WEBAUTHN_LOGIN_FAILED = 'auth-webauthn-login-failed';
107    case AUTH_WEBAUTHN_REMOVED = 'auth-webauthn-removed';
108
109    // Security Events
110    case SECURITY_UNAUTHORIZED_ACCESS = 'security-unauthorized-access';
111    case SECURITY_CSRF_VIOLATION = 'security-csrf-violation';
112    case SECURITY_PERMISSION_VIOLATION = 'security-permission-violation';
113    case SECURITY_SUSPICIOUS_ACTIVITY = 'security-suspicious-activity';
114    case SECURITY_RATE_LIMIT_EXCEEDED = 'security-rate-limit-exceeded';
115
116    // Data Exports
117    case DATA_EXPORT_USERS = 'data-export-users';
118    case DATA_EXPORT_SESSIONS = 'data-export-sessions';
119    case DATA_EXPORT_FAQS = 'data-export-faqs';
120    case DATA_EXPORT_LOGS = 'data-export-logs';
121
122    // API Security
123    case API_KEY_CREATED = 'api-key-created';
124    case API_KEY_REVOKED = 'api-key-revoked';
125    case API_UNAUTHORIZED_ACCESS = 'api-unauthorized-access';
126
127    // System Security
128    case SYSTEM_MAINTENANCE_MODE_ENABLED = 'system-maintenance-mode-enabled';
129    case SYSTEM_MAINTENANCE_MODE_DISABLED = 'system-maintenance-mode-disabled';
130    case SYSTEM_UPDATE_STARTED = 'system-update-started';
131    case SYSTEM_UPDATE_COMPLETED = 'system-update-completed';
132    case SYSTEM_UPDATE_FAILED = 'system-update-failed';
133}