check if admin change username pppoe or not
This commit is contained in:
parent
5d6a06b6fa
commit
95899b4eba
@ -524,8 +524,10 @@ switch ($action) {
|
|||||||
->find_many();
|
->find_many();
|
||||||
|
|
||||||
$oldusername = $c['username'];
|
$oldusername = $c['username'];
|
||||||
$oldPppoePassword = $c['password'];
|
$oldPppoeUsername = $c['pppoe_username'];
|
||||||
$oldPassPassword = $c['pppoe_password'];
|
$oldPppoePassword = $c['pppoe_password'];
|
||||||
|
$oldPppoeIp = $c['pppoe_ip'];
|
||||||
|
$oldPassPassword = $c['password'];
|
||||||
$userDiff = false;
|
$userDiff = false;
|
||||||
$pppoeDiff = false;
|
$pppoeDiff = false;
|
||||||
$passDiff = false;
|
$passDiff = false;
|
||||||
@ -536,7 +538,7 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
$userDiff = true;
|
$userDiff = true;
|
||||||
}
|
}
|
||||||
if ($oldPppoePassword != $pppoe_password) {
|
if ($oldPppoeUsername != $pppoe_username) {
|
||||||
$pppoeDiff = true;
|
$pppoeDiff = true;
|
||||||
}
|
}
|
||||||
if ($password != '' && $oldPassPassword != $password) {
|
if ($password != '' && $oldPassPassword != $password) {
|
||||||
@ -616,8 +618,6 @@ switch ($action) {
|
|||||||
if ($userDiff || $pppoeDiff || $passDiff) {
|
if ($userDiff || $pppoeDiff || $passDiff) {
|
||||||
$turs = ORM::for_table('tbl_user_recharges')->where('customer_id', $c['id'])->findMany();
|
$turs = ORM::for_table('tbl_user_recharges')->where('customer_id', $c['id'])->findMany();
|
||||||
foreach ($turs as $tur) {
|
foreach ($turs as $tur) {
|
||||||
$tur->username = $username;
|
|
||||||
$tur->save();
|
|
||||||
$p = ORM::for_table('tbl_plans')->find_one($tur['plan_id']);
|
$p = ORM::for_table('tbl_plans')->find_one($tur['plan_id']);
|
||||||
$dvc = Package::getDevice($p);
|
$dvc = Package::getDevice($p);
|
||||||
if ($_app_stage != 'demo') {
|
if ($_app_stage != 'demo') {
|
||||||
@ -628,12 +628,22 @@ switch ($action) {
|
|||||||
if ($userDiff) {
|
if ($userDiff) {
|
||||||
(new $p['device'])->change_username($p, $oldusername, $username);
|
(new $p['device'])->change_username($p, $oldusername, $username);
|
||||||
}
|
}
|
||||||
|
if ($pppoeDiff && $tur['type'] == 'PPPOE') {
|
||||||
|
if(empty($oldPppoeUsername)){
|
||||||
|
// admin just add pppoe username
|
||||||
|
(new $p['device'])->change_username($p, $username, $pppoe_username);
|
||||||
|
}else{
|
||||||
|
(new $p['device'])->change_username($p, $oldPppoeUsername, $pppoe_username);
|
||||||
|
}
|
||||||
|
}
|
||||||
(new $p['device'])->add_customer($c, $p);
|
(new $p['device'])->add_customer($c, $p);
|
||||||
} else {
|
} else {
|
||||||
new Exception(Lang::T("Devices Not Found"));
|
new Exception(Lang::T("Devices Not Found"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$tur->username = $username;
|
||||||
|
$tur->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
r2(U . 'customers/view/' . $id, 's', 'User Updated Successfully');
|
r2(U . 'customers/view/' . $id, 's', 'User Updated Successfully');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user