v1.0.0.6
Publisium
- <?php
-
- declare(strict_types=1);
-
- if (!AuthorProfile::isEnabled() || !Auth::canModerate()) {
- return ['Only editors can review author pages.', 'error', false];
- }
-
- $accountId = (int) ($_POST['account_id'] ?? 0);
- $decision = (string) ($_POST['decision'] ?? '');
-
- if ($accountId <= 0) {
- return ['We couldn’t find this author page.', 'error', false];
- }
-
- [$message, $type] = AuthorProfile::review($accountId, $_POST, $decision, (int) $currentUser['id'], (string) ($_POST['rejection_reason'] ?? ''));
-
- if ($type === 'success') {
- ActivityLog::record($decision === 'approve' ? 'profile.approve' : 'profile.reject', 'profile', $accountId);
- }
-
- return [$message, $type, $type === 'success'];
-