fix cron
This commit is contained in:
parent
a662291036
commit
6e263ca4bd
@ -109,9 +109,9 @@ switch ($action) {
|
|||||||
$ui->assign('devices', $devices);
|
$ui->assign('devices', $devices);
|
||||||
//select expired plan
|
//select expired plan
|
||||||
if ($d['is_radius']) {
|
if ($d['is_radius']) {
|
||||||
$exps = ORM::for_table('tbl_plans')->selects('id','name_plan')->where("is_radius", 1)->findArray();
|
$exps = ORM::for_table('tbl_plans')->selects('id', 'name_plan')->where('type', 'Hotspot')->where("is_radius", 1)->findArray();
|
||||||
} else {
|
} else {
|
||||||
$exps = ORM::for_table('tbl_plans')->selects('id','name_plan')->where("routers", $d['routers'])->findArray();
|
$exps = ORM::for_table('tbl_plans')->selects('id', 'name_plan')->where('type', 'Hotspot')->where("routers", $d['routers'])->findArray();
|
||||||
}
|
}
|
||||||
$ui->assign('exps', $exps);
|
$ui->assign('exps', $exps);
|
||||||
run_hook('view_edit_plan'); #HOOK
|
run_hook('view_edit_plan'); #HOOK
|
||||||
@ -219,7 +219,7 @@ switch ($action) {
|
|||||||
new Exception(Lang::T("Devices Not Found"));
|
new Exception(Lang::T("Devices Not Found"));
|
||||||
}
|
}
|
||||||
|
|
||||||
r2(U . 'services/hotspot', 's', Lang::T('Data Created Successfully'));
|
r2(U . 'services/edit/' . $d->id(), 's', Lang::T('Data Created Successfully'));
|
||||||
} else {
|
} else {
|
||||||
r2(U . 'services/add', 'e', $msg);
|
r2(U . 'services/add', 'e', $msg);
|
||||||
}
|
}
|
||||||
@ -388,9 +388,9 @@ switch ($action) {
|
|||||||
$ui->assign('devices', $devices);
|
$ui->assign('devices', $devices);
|
||||||
//select expired plan
|
//select expired plan
|
||||||
if ($d['is_radius']) {
|
if ($d['is_radius']) {
|
||||||
$exps = ORM::for_table('tbl_plans')->selects('id','name_plan')->where("is_radius", 1)->findArray();
|
$exps = ORM::for_table('tbl_plans')->selects('id', 'name_plan')->where('type', 'PPPOE')->where("is_radius", 1)->findArray();
|
||||||
} else {
|
} else {
|
||||||
$exps = ORM::for_table('tbl_plans')->selects('id','name_plan')->where("routers", $d['routers'])->findArray();
|
$exps = ORM::for_table('tbl_plans')->selects('id', 'name_plan')->where('type', 'PPPOE')->where("routers", $d['routers'])->findArray();
|
||||||
}
|
}
|
||||||
$ui->assign('exps', $exps);
|
$ui->assign('exps', $exps);
|
||||||
run_hook('view_edit_ppoe'); #HOOK
|
run_hook('view_edit_ppoe'); #HOOK
|
||||||
|
@ -21,7 +21,7 @@ $textExpired = Lang::getNotifText('expired');
|
|||||||
|
|
||||||
$d = ORM::for_table('tbl_user_recharges')->where('status', 'on')->where_lte('expiration', date("Y-m-d"))->find_many();
|
$d = ORM::for_table('tbl_user_recharges')->where('status', 'on')->where_lte('expiration', date("Y-m-d"))->find_many();
|
||||||
echo "Found " . count($d) . " user(s)\n";
|
echo "Found " . count($d) . " user(s)\n";
|
||||||
run_hook('cronjob'); #HOOK
|
//run_hook('cronjob'); #HOOK
|
||||||
|
|
||||||
foreach ($d as $ds) {
|
foreach ($d as $ds) {
|
||||||
$date_now = strtotime(date("Y-m-d H:i:s"));
|
$date_now = strtotime(date("Y-m-d H:i:s"));
|
||||||
@ -35,7 +35,7 @@ foreach ($d as $ds) {
|
|||||||
$dvc = Package::getDevice($p);
|
$dvc = Package::getDevice($p);
|
||||||
if (file_exists($dvc)) {
|
if (file_exists($dvc)) {
|
||||||
require_once $dvc;
|
require_once $dvc;
|
||||||
(new $p['device'])->remove_customer($ds['routers'], $c, $p);
|
(new $p['device'])->remove_customer($c, $p);
|
||||||
} else {
|
} else {
|
||||||
echo "Cron error Devices $p[device] not found, cannot disconnect $c[username]";
|
echo "Cron error Devices $p[device] not found, cannot disconnect $c[username]";
|
||||||
Message::sendTelegram("Cron error Devices $p[device] not found, cannot disconnect $c[username]");
|
Message::sendTelegram("Cron error Devices $p[device] not found, cannot disconnect $c[username]");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user