Update init.php

- add Boolean function isMysqlRadius() to check if the system is using Radius mysql or not.
This commit is contained in:
ABDALRAHMAN MOLOOD 2024-08-05 15:52:14 +03:00 committed by Ibnu Maksum
parent 7a95d79315
commit 5d6a06b6fa
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5

View File

@ -348,3 +348,13 @@ function displayMaintenanceMessage(): void
$ui->display('maintenance.tpl');
die();
}
function isMysqlRadius()
{
try {
$record = ORM::forTable('radacct', 'radius')->find_one();
return $record !== false;
} catch (Exception $e) {
return false;
}
}