mitrobill/system/radius.php

27 lines
827 B
PHP
Raw Normal View History

2022-09-08 10:43:46 +07:00
<?php
/**
2022-10-16 14:50:24 +07:00
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
2022-09-08 10:43:46 +07:00
**/
if(php_sapi_name() !== 'cli'){
die("RUN ON COMMAND LINE ONLY BY RADIUS ENGINE");
}
2023-09-06 10:48:52 +07:00
require_once __DIR__.File::pathFixer('/../config.php');
require_once __DIR__.File::pathFixer('orm.php');
require_once __DIR__.File::pathFixer('/autoload/PEAR2/Autoload.php');
include __DIR__.File::pathFixer("/autoload/Hookers.php");
2022-09-08 10:43:46 +07:00
use PEAR2\Net\RouterOS;
ORM::configure("mysql:host=$db_host;dbname=$db_name");
ORM::configure('username', $db_user);
ORM::configure('password', $db_password);
ORM::configure('return_result_sets', true);
ORM::configure('logging', true);
$result = ORM::for_table('tbl_appconfig')->find_many();
foreach($result as $value){
$config[$value['setting']]=$value['value'];
}
date_default_timezone_set($config['timezone']);