Update cron.php
radius rest interim update check
This commit is contained in:
parent
62c447da9b
commit
1906b1aefd
@ -103,6 +103,23 @@ foreach ($d as $ds) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Cek interim-update radiusrest
|
||||||
|
if ($config['frrest_interim_update'] != 0) {
|
||||||
|
|
||||||
|
$r_a = ORM::for_table('rad_acct')
|
||||||
|
->whereRaw("BINARY acctstatustype = 'Start' OR acctstatustype = 'Interim-Update'")
|
||||||
|
->where_lte('dateAdded', date("Y-m-d H:i:s"))->find_many();
|
||||||
|
|
||||||
|
foreach ($r_a as $ra) {
|
||||||
|
$interval = $_c['frrest_interim_update']*60;
|
||||||
|
$timeUpdate = strtotime($ra['dateAdded'])+$interval;
|
||||||
|
$timeNow = strtotime(date("Y-m-d H:i:s"));
|
||||||
|
if ($timeNow >= $timeUpdate) {
|
||||||
|
$ra->acctstatustype = 'Stop';
|
||||||
|
$ra->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($config['router_check']) {
|
if ($config['router_check']) {
|
||||||
echo "Checking router status...\n";
|
echo "Checking router status...\n";
|
||||||
@ -208,4 +225,4 @@ $timestampFile = "$UPLOAD_PATH/cron_last_run.txt";
|
|||||||
file_put_contents($timestampFile, time());
|
file_put_contents($timestampFile, time());
|
||||||
|
|
||||||
|
|
||||||
run_hook('cronjob_end'); #HOOK
|
run_hook('cronjob_end'); #HOOK
|
||||||
|
Loading…
x
Reference in New Issue
Block a user