| Server IP : 213.255.246.8 / Your IP : 216.73.217.138 Web Server : Apache System : Linux dublin.stapolin.com 5.14.0-362.18.1.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jan 29 07:05:48 EST 2024 x86_64 User : stapolin ( 1019) PHP Version : 8.4.24 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/stapolin/public_html/tracking.stapolin.com/admin/ |
Upload File : |
<?php
declare(strict_types=1);
require_once __DIR__ . '/../includes/bootstrap.php';
require_once APP_ROOT . '/includes/geoip_import.php';
$currentUser = require_role(['super_admin', 'admin']);
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
redirect('admin/system-health.php');
}
verify_csrf();
try {
if (function_exists('ignore_user_abort')) {
@ignore_user_abort(true);
}
if (function_exists('set_time_limit')) {
@set_time_limit(0);
}
$message = import_geoip_csv_files();
set_system_setting('cron.import_geoip_csv.status', json_encode([
'status' => 'success',
'started_at' => utc_now(),
'finished_at' => utc_now(),
'message' => $message,
], JSON_THROW_ON_ERROR));
audit_log((int) $currentUser['id'], 'geoip_csv.imported', null, ['message' => $message]);
flash('success', $message);
} catch (Throwable $exception) {
set_system_setting('cron.import_geoip_csv.status', json_encode([
'status' => 'failed',
'started_at' => utc_now(),
'finished_at' => utc_now(),
'message' => $exception->getMessage(),
], JSON_THROW_ON_ERROR));
error_log('Admin GeoIP CSV import failed: ' . $exception->getMessage());
flash('danger', 'GeoIP CSV import failed: ' . $exception->getMessage());
}
redirect('admin/system-health.php');