ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilAuthContainerMultiple Class Reference
+ Inheritance diagram for ilAuthContainerMultiple:
+ Collaboration diagram for ilAuthContainerMultiple:

Public Member Functions

 __construct ()
 Constructor. More...
 
 failedLoginObserver ($a_username, $a_auth)
 
 loginObserver ($a_username, $a_auth)
 
 checkAuthObserver ($a_username, $a_auth)
 
 fetchData ($user, $pass)
 
 supportsCaptchaVerification ()
 

Protected Attributes

 $current_container = null
 

Detailed Description

Author
Stefan Meyer smeye.nosp@m.r@le.nosp@m.ifos..nosp@m.com
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilAuthContainerMultiple::__construct ( )

Constructor.

Returns

Definition at line 45 of file class.ilAuthContainerMultiple.php.

46  {
47  parent::__construct();
48 
49  include_once './Services/Database/classes/class.ilAuthContainerMDB2.php';
50  $this->current_container = new ilAuthContainerMDB2();
51  }
Authentication against ILIAS database.

Member Function Documentation

◆ checkAuthObserver()

ilAuthContainerMultiple::checkAuthObserver (   $a_username,
  $a_auth 
)
See also
ilAuthContainerBase::checkAuthObserver()

Definition at line 80 of file class.ilAuthContainerMultiple.php.

81  {
82  $this->log('Container Multiple: checkAuthObserver',AUTH_LOG_DEBUG);
83  // Forward to current container
84  if($this->current_container instanceof Auth_Container)
85  {
86  $this->log('Container Multiple: Forwarding to '.get_class($this->current_container),AUTH_LOG_DEBUG);
87  return $this->current_container->checkAuthObserver($a_username, $a_auth);
88  }
89  return false;
90  }

◆ failedLoginObserver()

ilAuthContainerMultiple::failedLoginObserver (   $a_username,
  $a_auth 
)
See also
ilAuthContainerBase::failedLoginObserver()

Definition at line 56 of file class.ilAuthContainerMultiple.php.

57  {
58  $this->log('Auth_Container_Multiple: All containers rejected user credentials.', AUTH_LOG_DEBUG);
59  return false;
60  }

◆ fetchData()

ilAuthContainerMultiple::fetchData (   $user,
  $pass 
)

Definition at line 93 of file class.ilAuthContainerMultiple.php.

References $pass, $result, ilAuthModeDetermination\_getInstance(), AUTH_LDAP, AUTH_LOCAL, AUTH_RADIUS, AUTH_SOAP, ilAuthUtils\getAuthPlugins(), ilLoggerFactory\getLogger(), ilLDAPServer\getServerIdByAuthMode(), and PEAR\isError().

94  {
95  foreach(ilAuthModeDetermination::_getInstance()->getAuthModeSequence($user) as $auth_mode)
96  {
97  ilLoggerFactory::getLogger('auth')->debug('Current authmode is ' . $auth_mode . ' => ' . (int) $auth_mode);
98 
99  if ($_REQUEST['force_mode_apache'])
100  {
101  $this->log('Container Apache: Trying new container',AUTH_LOG_DEBUG);
102  include_once './Services/AuthApache/classes/class.ilAuthContainerApache.php';
103  $this->current_container = new ilAuthContainerApache();
104 
105  $auth = new ilAuthApache($this->current_container);
106  }
107  else
108  {
109  // begin-patch ldap_multiple
110  // cast to int
111  switch((int) $auth_mode)
112  {
113  case AUTH_LDAP:
114  $this->log('Container LDAP: Trying new container',AUTH_LOG_DEBUG);
115  include_once './Services/LDAP/classes/class.ilAuthContainerLDAP.php';
116  $sid = ilLDAPServer::getServerIdByAuthMode($auth_mode);
117  ilLoggerFactory::getLogger('auth')->debug('Trying LDAP server id ' . $sid);
118  $this->current_container = new ilAuthContainerLDAP($sid);
119  break;
120 
121  case AUTH_LOCAL:
122  $this->log('Container MDB2: Trying new container',AUTH_LOG_DEBUG);
123  include_once './Services/Database/classes/class.ilAuthContainerMDB2.php';
124  $this->current_container = new ilAuthContainerMDB2();
125  break;
126 
127  case AUTH_SOAP:
128  $this->log('Container SOAP: Trying new container',AUTH_LOG_DEBUG);
129  include_once './Services/SOAPAuth/classes/class.ilAuthContainerSOAP.php';
130  $this->current_container = new ilAuthContainerSOAP();
131  break;
132 
133  case AUTH_RADIUS:
134  $this->log('Container Radius: Trying new container',AUTH_LOG_DEBUG);
135  include_once './Services/Radius/classes/class.ilAuthContainerRadius.php';
136  $this->current_container = new ilAuthContainerRadius();
137  break;
138 
139  // begin-patch auth_plugin
140  default:
141  $this->log('Container Plugin: Trying new container',AUTH_LOG_DEBUG);
142  foreach(ilAuthUtils::getAuthPlugins() as $pl)
143  {
144  $container = $pl->getContainer($auth_mode);
145  if($container instanceof Auth_Container)
146  {
147  $this->current_container = $container;
148  break;
149  }
150  }
151  break;
152  // end-patch auth_plugin
153 
154  }
155  }
156  $this->current_container->_auth_obj = $this->_auth_obj;
157 
158  $result = $this->current_container->fetchData($user, $pass);
159 
160  if (PEAR::isError($result))
161  {
162  $this->log('Container '.$key.': '.$result->getMessage(), AUTH_LOG_ERR);
163  // Do not return here, otherwise wrong configured auth modes might block ilias database authentication
164  }
165  elseif ($result == true)
166  {
167  $this->log('Container '.$key.': Authentication successful.', AUTH_LOG_DEBUG);
168  return true;
169  }
170  else
171  {
172  $this->log('Container '.$key.': Authentication failed.', AUTH_LOG_DEBUG);
173  }
174  }
175  return false;
176  }
$result
Overwritten Pear class AuthContainerLDAP This class is overwritten to support nested groups...
const AUTH_LDAP
Authentication against ILIAS database.
static getAuthPlugins()
Get active enabled auth plugins.
Apache based authentication
const AUTH_LOCAL
static getServerIdByAuthMode($a_auth_mode)
Get auth id by auth mode.
const AUTH_SOAP
Overwritten Pear class AuthContainerRadius This class is overwritten to support to perform Radius aut...
Authentication against ILIAS database.
static getLogger($a_component_id)
Get component logger.
Authentication against external SOAP server
isError($data, $code=null)
Tell whether a value is a PEAR error.
Definition: PEAR.php:280
const AUTH_RADIUS
+ Here is the call graph for this function:

◆ loginObserver()

ilAuthContainerMultiple::loginObserver (   $a_username,
  $a_auth 
)
See also
ilAuthContainerBase::loginObserver()

Definition at line 65 of file class.ilAuthContainerMultiple.php.

66  {
67  $this->log('Container Multiple: loginObserver'.get_class($this->current_container),AUTH_LOG_DEBUG);
68  // Forward to current container
69  if($this->current_container instanceof Auth_Container)
70  {
71  $this->log('Container Multiple: Forwarding to '.get_class($this->current_container),AUTH_LOG_DEBUG);
72  return $this->current_container->loginObserver($a_username, $a_auth);
73  }
74  return false;
75  }

◆ supportsCaptchaVerification()

ilAuthContainerMultiple::supportsCaptchaVerification ( )
Returns
bool

Definition at line 181 of file class.ilAuthContainerMultiple.php.

182  {
183  return true;
184  }

Field Documentation

◆ $current_container

ilAuthContainerMultiple::$current_container = null
protected

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


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