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 GitHub
parent d138e1b36f
commit 810c5ae827
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;
}
}