check if radius tabel exists

This commit is contained in:
Ibnu Maksum 2023-10-06 16:57:18 +07:00
parent 1a48bfa0ff
commit c76aefb7e0
No known key found for this signature in database
GPG key ID: 7FC82848810579E5

View file

@ -34,7 +34,7 @@ switch ($action) {
$folders = [];
$files = scandir('system/lan/');
foreach ($files as $file) {
if(is_dir('system/lan/'.$file) && !in_array($file,['.','..'])){
if (is_dir('system/lan/' . $file) && !in_array($file, ['.', '..'])) {
$folders[] = $file;
}
}
@ -424,6 +424,19 @@ switch ($action) {
$d->save();
}
if ($radius_enable) {
try {
ORM::for_table('nasi', 'radius')->where('setting', 'tawkto')->find_one();
} catch (Exception $e) {
$ui->assign("error_title", "RADIUS Error");
$ui->assign("error_message", "Radius table not found.<br><br>" .
$e->getMessage() .
"<br><br>Download <a href=\"https://raw.githubusercontent.com/hotspotbilling/phpnuxbill/Development/install/radius.sql\">here</a> or <a href=\"https://raw.githubusercontent.com/hotspotbilling/phpnuxbill/master/install/radius.sql\">here</a> and import it to database.<br><br>Check config.php for radius connection details");
$ui->display('router-error.tpl');
die();
}
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'radius_enable')->find_one();
if ($d) {
$d->value = $radius_enable;