ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAuthContainerRadius Class Reference

Overwritten Pear class AuthContainerRadius This class is overwritten to support to perform Radius authentication with specific ILIAS options. More...

+ Inheritance diagram for ilAuthContainerRadius:
+ Collaboration diagram for ilAuthContainerRadius:

Public Member Functions

 __construct ()
 Constructor.
 forceCreation ($a_status)
 Force creation of user accounts.
 loginObserver ($a_username, $a_auth)
 Called from base class after successful login.

Private Member Functions

 initSettings ()
 Init radius settings.
 initRADIUSAttributeToUser ()
 Init RADIUS attribute mapping.

Private Attributes

 $radius_settings = null
 $rad_to_user = null
 $log = null
 $force_creation = false

Detailed Description

Overwritten Pear class AuthContainerRadius This class is overwritten to support to perform Radius authentication with specific ILIAS options.

Author
Stefan Meyer <smeyer.de>
Version
$Id$

Definition at line 37 of file class.ilAuthContainerRadius.php.

Constructor & Destructor Documentation

ilAuthContainerRadius::__construct ( )

Constructor.

public

Parameters
arrayAn associative array of pear parameters

Definition at line 51 of file class.ilAuthContainerRadius.php.

References initSettings(), and ilRadiusSettings\RADIUS_CHARSET_LATIN1.

{
$this->initSettings();
// Convert password to latin1
if($this->radius_settings->getCharset() == ilRadiusSettings::RADIUS_CHARSET_LATIN1)
{
#$_POST['username'] = utf8_decode($_POST['username']);
#$_POST['password'] = utf8_decode($_POST['password']);
$this->log->write(__METHOD__.': Decoded username and password to latin1.');
}
parent::__construct($this->radius_settings->toPearAuthArray());
}

+ Here is the call graph for this function:

Member Function Documentation

ilAuthContainerRadius::forceCreation (   $a_status)

Force creation of user accounts.

public

Parameters
boolforce_creation

Definition at line 74 of file class.ilAuthContainerRadius.php.

{
$this->force_creation = true;
}
ilAuthContainerRadius::initRADIUSAttributeToUser ( )
private

Init RADIUS attribute mapping.

private

Definition at line 141 of file class.ilAuthContainerRadius.php.

Referenced by loginObserver().

{
include_once('Services/Radius/classes/class.ilRadiusAttributeToUser.php');
$this->radius_user = new ilRadiusAttributeToUser();
}

+ Here is the caller graph for this function:

ilAuthContainerRadius::initSettings ( )
private

Init radius settings.

Returns
void

Definition at line 128 of file class.ilAuthContainerRadius.php.

References ilRadiusSettings\_getInstance().

Referenced by __construct().

{
include_once 'Services/Radius/classes/class.ilRadiusSettings.php';
$this->radius_settings = ilRadiusSettings::_getInstance();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthContainerRadius::loginObserver (   $a_username,
  $a_auth 
)

Called from base class after successful login.

Parameters
stringusername

Definition at line 84 of file class.ilAuthContainerRadius.php.

References $_POST, $_SESSION, $force_creation, ilObjUser\_checkExternalAuthAccount(), AUTH_RADIUS_NO_ILIAS_USER, initRADIUSAttributeToUser(), and ilUtil\redirect().

{
$user_data = array_change_key_case($a_auth->getAuthData(),CASE_LOWER);
$user_data['ilInternalAccount'] = ilObjUser::_checkExternalAuthAccount("radius",$a_username);
if(!$user_data['ilInternalAccount'])
{
if($this->radius_settings->enabledCreation())
{
if($this->radius_settings->isAccountMigrationEnabled() and !$this->force_creation)
{
$a_auth->logout();
$_SESSION['tmp_auth_mode'] = 'radius';
$_SESSION['tmp_external_account'] = $a_username;
$_SESSION['tmp_pass'] = $_POST['password'];
$_SESSION['tmp_roles'] = array(0 => $this->radius_settings->getDefaultRole());
ilUtil::redirect('ilias.php?baseClass=ilStartUpGUI&cmd=showAccountMigration&cmdClass=ilstartupgui');
}
$new_name = $this->radius_user->create($a_username);
$a_auth->setAuth($new_name);
return true;
}
else
{
// No syncronisation allowed => create Error
$a_auth->status = AUTH_RADIUS_NO_ILIAS_USER;
$a_auth->logout();
return false;
}
}
else
{
$a_auth->setAuth($user_data['ilInternalAccount']);
return true;
}
}

+ Here is the call graph for this function:

Field Documentation

ilAuthContainerRadius::$force_creation = false
private

Definition at line 42 of file class.ilAuthContainerRadius.php.

Referenced by loginObserver().

ilAuthContainerRadius::$log = null
private

Definition at line 41 of file class.ilAuthContainerRadius.php.

ilAuthContainerRadius::$rad_to_user = null
private

Definition at line 40 of file class.ilAuthContainerRadius.php.

ilAuthContainerRadius::$radius_settings = null
private

Definition at line 39 of file class.ilAuthContainerRadius.php.


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