radius move to expired pool
This commit is contained in:
parent
92f072a861
commit
6a6434b39c
@ -283,7 +283,7 @@ class Radius
|
||||
/**
|
||||
* To insert or update existing customer Attribute
|
||||
*/
|
||||
private static function upsertCustomerAttr($username, $attr, $value, $op = ':=')
|
||||
public static function upsertCustomerAttr($username, $attr, $value, $op = ':=')
|
||||
{
|
||||
$r = Radius::getTableCustomerAttr()->where_equal('username', $username)->whereEqual('attribute', $attr)->find_one();
|
||||
if (!$r) {
|
||||
|
@ -103,8 +103,13 @@ foreach ($d as $ds) {
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $u['plan_id'])->find_one();
|
||||
|
||||
if ($p['is_radius']) {
|
||||
echo Radius::customerDeactivate($c['username']);
|
||||
}else{
|
||||
if (!empty($p['pool_expired'])) {
|
||||
print_r(Radius::customerDeactivate($c['username']));
|
||||
} else {
|
||||
Radius::upsertCustomerAttr($c['username'], 'Framed-Pool', $plan['pool_expired'], ':=');
|
||||
print_r(Radius::disconnectCustomer($c['username']));
|
||||
}
|
||||
} else {
|
||||
$client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']);
|
||||
if (!empty($p['pool_expired'])) {
|
||||
Mikrotik::setHotspotUserPackage($client, $c['username'], 'EXPIRED NUXBILL ' . $p['pool_expired']);
|
||||
@ -152,8 +157,13 @@ foreach ($d as $ds) {
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $u['plan_id'])->find_one();
|
||||
|
||||
if ($p['is_radius']) {
|
||||
echo Radius::customerDeactivate($c['username']);
|
||||
}else{
|
||||
if (!empty($p['pool_expired'])) {
|
||||
print_r(Radius::customerDeactivate($c['username']));
|
||||
} else {
|
||||
Radius::upsertCustomerAttr($c['username'], 'Framed-Pool', $plan['pool_expired'], ':=');
|
||||
print_r(Radius::disconnectCustomer($c['username']));
|
||||
}
|
||||
} else {
|
||||
$client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']);
|
||||
if (!empty($p['pool_expired'])) {
|
||||
Mikrotik::setPpoeUserPlan($client, $c['username'], 'EXPIRED NUXBILL ' . $p['pool_expired']);
|
||||
|
Loading…
x
Reference in New Issue
Block a user