ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_Container_RADIUS Class Reference
+ Inheritance diagram for Auth_Container_RADIUS:
+ Collaboration diagram for Auth_Container_RADIUS:

Public Member Functions

 Auth_Container_RADIUS ($options)
 Constructor of the container class.
 fetchData ($username, $password, $challenge=null)
 Authenticate.
- Public Member Functions inherited from Auth_Container
 Auth_Container ()
 Constructor.
 verifyPassword ($password1, $password2, $cryptType="md5")
 Crypt and verfiy the entered password.
 supportsChallengeResponse ()
 Returns true if the container supports Challenge Response password authentication.
 getCryptType ()
 Returns the crypt current crypt type of the container.
 listUsers ()
 List all users that are available from the storage container.
 getUser ($username)
 Returns a user assoc array.
 addUser ($username, $password, $additional=null)
 Add a new user to the storage container.
 removeUser ($username)
 Remove user from the storage container.
 changePassword ($username, $password)
 Change password for user in the storage container.
 log ($message, $level=AUTH_LOG_DEBUG)
 Log a message to the Auth log.
- Public Member Functions inherited from ilAuthContainerBase
 loginObserver ($a_username, $a_auth)
 Called after successful login.
 failedLoginObserver ($a_username, $a_auth)
 Called after failed login.
 checkAuthObserver ($a_username, $a_auth)
 Called after check auth requests.
 logoutObserver ($a_username, $a_auth)
 Called after logout.

Data Fields

 $radius
 $authtype
- Data Fields inherited from Auth_Container
 $activeUser = ""
 User that is currently selected from the storage container.
 $_auth_obj = null
 The Auth object this container is attached to.

Detailed Description

Definition at line 48 of file RADIUS.php.

Member Function Documentation

Auth_Container_RADIUS::Auth_Container_RADIUS (   $options)

Constructor of the container class.

$options can have these keys: 'servers' an array containing an array: servername, port, sharedsecret, timeout, maxtries 'configfile' The filename of the configuration file 'authtype' The type of authentication, one of: PAP, CHAP_MD5, MSCHAPv1, MSCHAPv2, default is PAP

Parameters
$optionsassociative array
Returns
object Returns an error object if something went wrong

Definition at line 81 of file RADIUS.php.

References $authtype, $server, PEAR_ERROR_DIE, and PEAR\raiseError().

{
$this->authtype = 'PAP';
if (isset($options['authtype'])) {
$this->authtype = $options['authtype'];
}
$classname = 'Auth_RADIUS_' . $this->authtype;
if (!class_exists($classname)) {
PEAR::raiseError("Unknown Authtype, please use one of: "
."PAP, CHAP_MD5, MSCHAPv1, MSCHAPv2!", 41, PEAR_ERROR_DIE);
}
$this->radius = new $classname;
if (isset($options['configfile'])) {
$this->radius->setConfigfile($options['configfile']);
}
$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);
}
}

+ Here is the call graph for this function:

Auth_Container_RADIUS::fetchData (   $username,
  $password,
  $challenge = null 
)

Authenticate.

Parameters
stringUsername
stringPassword
Returns
bool true on success, false on reject

Reimplemented from Auth_Container.

Definition at line 126 of file RADIUS.php.

References $authtype, AUTH_LOG_DEBUG, PEAR\isError(), and Auth_Container\log().

{
$this->log('Auth_Container_RADIUS::fetchData() called.', AUTH_LOG_DEBUG);
switch($this->authtype) {
case 'CHAP_MD5':
case 'MSCHAPv1':
if (isset($challenge)) {
$this->radius->challenge = $challenge;
$this->radius->chapid = 1;
$this->radius->response = pack('H*', $password);
} else {
require_once 'Crypt/CHAP.php';
$classname = 'Crypt_' . $this->authtype;
$crpt = new $classname;
$crpt->password = $password;
$this->radius->challenge = $crpt->challenge;
$this->radius->chapid = $crpt->chapid;
$this->radius->response = $crpt->challengeResponse();
}
break;
case 'MSCHAPv2':
require_once 'Crypt/CHAP.php';
$crpt = new Crypt_MSCHAPv2;
$crpt->username = $username;
$crpt->password = $password;
$this->radius->challenge = $crpt->authChallenge;
$this->radius->peerChallenge = $crpt->peerChallenge;
$this->radius->chapid = $crpt->chapid;
$this->radius->response = $crpt->challengeResponse();
break;
default:
$this->radius->password = $password;
break;
}
$this->radius->username = $username;
$this->radius->putAuthAttributes();
$result = $this->radius->send();
if (PEAR::isError($result)) {
return false;
}
$this->radius->getAttributes();
// just for debugging
// $this->radius->dumpAttributes();
return $result;
}

+ Here is the call graph for this function:

Field Documentation

Auth_Container_RADIUS::$authtype

Definition at line 63 of file RADIUS.php.

Referenced by Auth_Container_RADIUS(), and fetchData().

Auth_Container_RADIUS::$radius

Definition at line 57 of file RADIUS.php.


The documentation for this class was generated from the following file: