mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-05 10:44:52 +02:00
add change_username function
This commit is contained in:
parent
27aeb93b57
commit
938173cab7
6 changed files with 56 additions and 18 deletions
|
@ -42,6 +42,24 @@ class Radius
|
|||
}
|
||||
}
|
||||
|
||||
public function change_username($from, $to)
|
||||
{
|
||||
$c = $this->getTableCustomer()->where_equal('username', $from)->findMany();
|
||||
if ($c) {
|
||||
foreach ($c as $u) {
|
||||
$u->username = $to;
|
||||
$u->save();
|
||||
}
|
||||
}
|
||||
$c = $this->getTableUserPackage()->where_equal('username', $from)->findMany();
|
||||
if ($c) {
|
||||
foreach ($c as $u) {
|
||||
$u->username = $to;
|
||||
$u->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function add_plan($plan)
|
||||
{
|
||||
$bw = ORM::for_table("tbl_bandwidth")->find_one($plan['id_bw']);
|
||||
|
@ -169,24 +187,6 @@ class Radius
|
|||
return $n->save();
|
||||
}
|
||||
|
||||
public function customerChangeUsername($from, $to)
|
||||
{
|
||||
$c = $this->getTableCustomer()->where_equal('username', $from)->findMany();
|
||||
if ($c) {
|
||||
foreach ($c as $u) {
|
||||
$u->username = $to;
|
||||
$u->save();
|
||||
}
|
||||
}
|
||||
$c = $this->getTableUserPackage()->where_equal('username', $from)->findMany();
|
||||
if ($c) {
|
||||
foreach ($c as $u) {
|
||||
$u->username = $to;
|
||||
$u->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function customerDeactivate($username, $radiusDisconnect = true)
|
||||
{ {
|
||||
global $radius_pass;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue