Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.1.8

Bug #19800 An error in the function Auth_Container_RADIUS ($ options)
Submitted: 2013-01-28 00:48 UTC
From: dmitry_mass Assigned:
Status: Open Package: Auth_HTTP (version 2.1.8)
PHP Version: 5.4.10 OS: freebsd 9.1
Roadmaps: (Not assigned)    
Subscription  


 [2013-01-28 00:48 UTC] dmitry_mass (Dmitry Mass)
Description: ------------ require_once("Auth/HTTP.php"); require_once 'Auth/RADIUS.php'; require_once 'Crypt/CHAP.php'; $aro = array ( 'servers' => array( 'host'=>"192.168.250.5", 'port'=>0, 'sharedsecret'=>"FreeBSD91"), 'authtype'=> "MSCHAPv1", ); echo "main func\n"; var_dump($aro); $a = new Auth_HTTP("RADIUS", $aro); $a->setRealm('Site AZS'); // realm name $a->setCancelText('<h2>Error 401</h2>'); // error message if authentication fails echo 'start func'; $a->start(); // starting the authentication process echo 'get func'; if($a->getAuth()) // checking for autenticated user { echo "Hello $a->username welcome to my secret page"; }; Expected result: ---------------- $servers = $options['servers']; if (is_array($servers)) { foreach ($servers as $server) { $servername = $server[0]; $port = isset($server[1]) ? $server[1] : 0; $sharedsecret = isset($server[2]) ? $server[2] : 'testing123'; $timeout = isset($server[3]) ? $server[3] : 3; $maxtries = isset($server[4]) ? $server[4] : 3; $this->radius->addServer($servername, $port, $sharedsecret, $timeout, $maxtries); } } if (!$this->radius->start()) { PEAR::raiseError($this->radius->getError(), 41, PEAR_ERROR_DIE); } } Actual result: -------------- PHP Warning: radius_add_server() expects parameter 5 to be long, string given in /usr/local/share/pear/Auth/RADIUS.php on line 320 PHP Stack trace: PHP 1. {main}() /usr/local/www/azs/auth_http_ex1.php:0 PHP 2. Auth->start() /usr/local/www/azs/auth_http_ex1.php:36 PHP 3. Auth_HTTP->login() /usr/local/share/pear/Auth.php:528 PHP 4. Auth->_loadStorage() /usr/local/share/pear/Auth/HTTP.php:356 PHP 5. Auth->_factory() /usr/local/share/pear/Auth.php:445 PHP 6. Auth_Container_RADIUS->Auth_Container_RADIUS() /usr/local/share/pear/Auth.php:469 PHP 7. Auth_RADIUS->start() /usr/local/share/pear/Auth/Container/RADIUS.php:112 PHP 8. Auth_RADIUS->putServer() /usr/local/share/pear/Auth/RADIUS.php:355 PHP 9. radius_add_server() /usr/local/share/pear/Auth/RADIUS.php:320

Comments