mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-07-22 11:54:36 +02:00
fix radius rest pppoe_username
This commit is contained in:
parent
7c547c967e
commit
daf1bb7d67
1 changed files with 9 additions and 1 deletions
10
radius.php
10
radius.php
|
@ -162,14 +162,16 @@ try {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
$c = ORM::for_table('tbl_customers')->select('password')->select('pppoe_password')->whereRaw("BINARY pppoe_username = '$username' AND status = 'Active'")->find_one();
|
||||
$c = ORM::for_table('tbl_customers')->select('password')->select('username')->select('pppoe_password')->whereRaw("BINARY pppoe_username = '$username' AND status = 'Active'")->find_one();
|
||||
if ($c) {
|
||||
if (Password::chap_verify($c['password'], $CHAPassword, $CHAPchallenge)) {
|
||||
$password = $c['password'];
|
||||
$username = $c['username'];
|
||||
$isVoucher = false;
|
||||
$isCHAP = true;
|
||||
} else if (!empty($c['pppoe_password']) && Password::chap_verify($c['pppoe_password'], $CHAPassword, $CHAPchallenge)) {
|
||||
$password = $c['pppoe_password'];
|
||||
$username = $c['username'];
|
||||
$isVoucher = false;
|
||||
$isCHAP = true;
|
||||
} else {
|
||||
|
@ -202,6 +204,12 @@ try {
|
|||
}
|
||||
}
|
||||
$tur = ORM::for_table('tbl_user_recharges')->whereRaw("BINARY username = '$username'")->find_one();
|
||||
if (!$tur) {
|
||||
// if check if pppoe_username
|
||||
$c = ORM::for_table('tbl_customers')->select('username')->select('pppoe_password')->whereRaw("BINARY pppoe_username = '$username'")->find_one();
|
||||
$username = $c['username'];
|
||||
$tur = ORM::for_table('tbl_user_recharges')->whereRaw("BINARY username = '$username'")->find_one();
|
||||
}
|
||||
if ($tur) {
|
||||
if (!$isVoucher && !$isCHAP) {
|
||||
$d = ORM::for_table('tbl_customers')->select('password')->select('pppoe_password')->whereRaw("BINARY username = '$username' AND status = 'Active'")->find_one();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue