add expired notification
This commit is contained in:
parent
3130310d9c
commit
b10cfa2a8e
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
|
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
|
||||||
**/
|
**/
|
||||||
@ -19,8 +20,7 @@ include "autoload/Hookers.php";
|
|||||||
|
|
||||||
|
|
||||||
//register all plugin
|
//register all plugin
|
||||||
foreach (glob("system/plugin/*.php") as $filename)
|
foreach (glob("system/plugin/*.php") as $filename) {
|
||||||
{
|
|
||||||
include $filename;
|
include $filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,6 +55,8 @@ foreach($result as $value){
|
|||||||
}
|
}
|
||||||
date_default_timezone_set($config['timezone']);
|
date_default_timezone_set($config['timezone']);
|
||||||
|
|
||||||
|
$textExpired = $config['user_notification_expired_text'];
|
||||||
|
|
||||||
$d = ORM::for_table('tbl_user_recharges')->where('status', 'on')->find_many();
|
$d = ORM::for_table('tbl_user_recharges')->where('status', 'on')->find_many();
|
||||||
|
|
||||||
run_hook('cronjob'); #HOOK
|
run_hook('cronjob'); #HOOK
|
||||||
@ -74,8 +76,8 @@ foreach ($d as $ds){
|
|||||||
$client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']);
|
$client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']);
|
||||||
Mikrotik::setHotspotLimitUptime($client, $c['username']);
|
Mikrotik::setHotspotLimitUptime($client, $c['username']);
|
||||||
Mikrotik::removeHotspotActiveUser($client, $c['username']);
|
Mikrotik::removeHotspotActiveUser($client, $c['username']);
|
||||||
|
Message::sendExpiredNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $textExpired, $config['user_notification_expired']);
|
||||||
}
|
}
|
||||||
|
|
||||||
//update database user dengan status off
|
//update database user dengan status off
|
||||||
$u->status = 'off';
|
$u->status = 'off';
|
||||||
$u->save();
|
$u->save();
|
||||||
@ -94,6 +96,7 @@ foreach ($d as $ds){
|
|||||||
$client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']);
|
$client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']);
|
||||||
Mikrotik::disablePpoeUser($client, $c['username']);
|
Mikrotik::disablePpoeUser($client, $c['username']);
|
||||||
Mikrotik::removePpoeActive($client, $c['username']);
|
Mikrotik::removePpoeActive($client, $c['username']);
|
||||||
|
Message::sendExpiredNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $textExpired, $config['user_notification_expired']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$u->status = 'off';
|
$u->status = 'off';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user