update control and reply in 1 php page
hello , I am using freeradius 3.0.11 and iam using this : update{ control: += `/usr/bin/php5.6 /var/www/html/update.php %{User-Name} %{User-Password} 1` } update{ reply: += `/usr/bin/php5.6 /var/www/html/update.php %{User-Name} %{%{User-Password}} 2 ` } update.php <?php $user = @$argv[1]; $pass = @$argv[2]; $val = @$argv[3]; if ($val == 1){ echo "Framed-Pool :=pool1\n"; }else{ echo "Reply-Message :=Hello '\n"; } ?> but this code is very slow and i want do this update{ `/usr/bin/php5.6 /var/www/html/update.php %{User-Name} %{User-Password} 1` } update.php <?php $user = @$argv[1]; $pass = @$argv[2]; $val = @$argv[3]; if ($val == 1){ echo " control: += \n Framed-Pool :=pool1\n"; }else{ echo " reply: += \n Reply-Message :=Hello '\n"; } Sorry for my english
On Apr 28, 2018, at 3:07 PM, تعلم البرمجة <mido2010bona@gmail.com> wrote:
I am using freeradius 3.0.11 and iam using this :
update{ control: += `/usr/bin/php5.6 /var/www/html/update.php %{User-Name} %{User-Password} 1` } update{ reply: += `/usr/bin/php5.6 /var/www/html/update.php %{User-Name} %{%{User-Password}} 2 ` }
It's best to not use external scripts.
update.php
<?php $user = @$argv[1]; $pass = @$argv[2]; $val = @$argv[3];
if ($val == 1){ echo "Framed-Pool :=pool1\n"; }else{ echo "Reply-Message :=Hello '\n"; }
All that can be done in "unlang". There's no need to use PHP.
?>
but this code is very slow and i want do this
Use unlang. Don't use PHP. Alan DeKok.
but i want use php this code is simple for you but i have more with sql and functions and i cant use it by unlang 2018-04-28 21:07 GMT+02:00 تعلم البرمجة <mido2010bona@gmail.com>:
hello ,
I am using freeradius 3.0.11 and iam using this :
update{ control: += `/usr/bin/php5.6 /var/www/html/update.php %{User-Name} %{User-Password} 1` } update{ reply: += `/usr/bin/php5.6 /var/www/html/update.php %{User-Name} %{%{User-Password}} 2 ` }
update.php
<?php $user = @$argv[1]; $pass = @$argv[2]; $val = @$argv[3];
if ($val == 1){ echo "Framed-Pool :=pool1\n"; }else{ echo "Reply-Message :=Hello '\n"; }
?>
but this code is very slow and i want do this
update{ `/usr/bin/php5.6 /var/www/html/update.php %{User-Name} %{User-Password} 1` }
update.php
<?php $user = @$argv[1]; $pass = @$argv[2]; $val = @$argv[3];
if ($val == 1){ echo " control: += \n Framed-Pool :=pool1\n"; }else{ echo " reply: += \n Reply-Message :=Hello '\n"; }
Sorry for my english
Hi. You can set everything you need in control and then copy it to reply with ============== update reply { Reply-Message := &control:Reply-Message } ============== But Alan is right, this still will be slow. On 29.04.2018 12:43, تعلم البرمجة wrote:
but i want use php this code is simple for you but i have more with sql and functions and i cant use it by unlang
2018-04-28 21:07 GMT+02:00 تعلم البرمجة <mido2010bona@gmail.com>:
hello ,
I am using freeradius 3.0.11 and iam using this :
update{ control: += `/usr/bin/php5.6 /var/www/html/update.php %{User-Name} %{User-Password} 1` } update{ reply: += `/usr/bin/php5.6 /var/www/html/update.php %{User-Name} %{%{User-Password}} 2 ` }
update.php
<?php $user = @$argv[1]; $pass = @$argv[2]; $val = @$argv[3];
if ($val == 1){ echo "Framed-Pool :=pool1\n"; }else{ echo "Reply-Message :=Hello '\n"; }
?>
but this code is very slow and i want do this
update{ `/usr/bin/php5.6 /var/www/html/update.php %{User-Name} %{User-Password} 1` }
update.php
<?php $user = @$argv[1]; $pass = @$argv[2]; $val = @$argv[3];
if ($val == 1){ echo " control: += \n Framed-Pool :=pool1\n"; }else{ echo " reply: += \n Reply-Message :=Hello '\n"; }
Sorry for my english
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Boris Lytochkin Yandex NOC +7 (495) 739 70 00 ext. 7671
On Apr 29, 2018, at 5:43 AM, تعلم البرمجة <mido2010bona@gmail.com> wrote:
but i want use php this code is simple for you but i have more with sql and functions and i cant use it by unlang
You can probably do 99% of it with unlang. The parts that can't be done with unlang could be implemented in Perl or Python. Which run inside of FreeRADIUS. And are therefore about 10x faster than PHP. Alan DeKok.
On 29/04/18 10:43, تعلم البرمجة wrote:
but i want use php this code is simple for you but i have more with sql and functions and i cant use it by unlang
Have a look at the recent thread "Using unlang / SQL with single return value; couple of questions." which might give you some ideas of how to do what you want in SQL / unlang.
participants (4)
-
Alan DeKok -
Boris Lytochkin -
Dom Latter -
تعلم البرمجة