29require_once
"Auth/Container.php";
33require_once
"Auth/RADIUS.php";
83 $this->authtype =
'PAP';
85 $this->authtype =
$options[
'authtype'];
88 if (!class_exists($classname)) {
93 $this->radius =
new $classname;
96 $this->radius->setConfigfile(
$options[
'configfile']);
100 if (is_array($servers)) {
101 foreach ($servers as
$server) {
107 $this->radius->addServer($servername, $port, $sharedsecret, $timeout, $maxtries);
111 if (!$this->radius->start()) {
126 function fetchData($username, $password, $challenge =
null)
130 switch($this->authtype) {
133 if (isset($challenge)) {
134 $this->radius->challenge = $challenge;
135 $this->radius->chapid = 1;
136 $this->radius->response = pack(
'H*', $password);
138 require_once
'Crypt/CHAP.php';
140 $crpt =
new $classname;
141 $crpt->password = $password;
142 $this->radius->challenge = $crpt->challenge;
143 $this->radius->chapid = $crpt->chapid;
144 $this->radius->response = $crpt->challengeResponse();
149 require_once
'Crypt/CHAP.php';
150 $crpt =
new Crypt_MSCHAPv2;
151 $crpt->username = $username;
152 $crpt->password = $password;
153 $this->radius->challenge = $crpt->authChallenge;
154 $this->radius->peerChallenge = $crpt->peerChallenge;
155 $this->radius->chapid = $crpt->chapid;
156 $this->radius->response = $crpt->challengeResponse();
160 $this->radius->password = $password;
164 $this->radius->username = $username;
166 $this->radius->putAuthAttributes();
167 $result = $this->radius->send();
172 $this->radius->getAttributes();
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
fetchData($username, $password, $challenge=null)
Authenticate.
Auth_Container_RADIUS($options)
Constructor of the container class.
log($message, $level=AUTH_LOG_DEBUG)
Log a message to the Auth log.
isError($data, $code=null)
Tell whether a value is a PEAR error.
& raiseError($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
This method is a wrapper that returns an instance of the configured error class with this object's de...
if(!is_array($argv)) $options