ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 ()
 
- Public Member Functions inherited from Auth_Container
 Auth_Container ()
 Constructor. More...
 
 fetchData ($username, $password, $isChallengeResponse=false)
 Fetch data from storage container. More...
 
 verifyPassword ($password1, $password2, $cryptType="md5")
 Crypt and verfiy the entered password. More...
 
 supportsChallengeResponse ()
 Returns true if the container supports Challenge Response password authentication. More...
 
 getCryptType ()
 Returns the crypt current crypt type of the container. More...
 
 listUsers ()
 List all users that are available from the storage container. More...
 
 getUser ($username)
 Returns a user assoc array. More...
 
 addUser ($username, $password, $additional=null)
 Add a new user to the storage container. More...
 
 removeUser ($username)
 Remove user from the storage container. More...
 
 changePassword ($username, $password)
 Change password for user in the storage container. More...
 
 log ($message, $level=AUTH_LOG_DEBUG)
 Log a message to the Auth log. More...
 
- Public Member Functions inherited from ilAuthContainerBase
 loginObserver ($a_username, $a_auth)
 Called after successful login. More...
 
 failedLoginObserver ($a_username, $a_auth)
 Called after failed login. More...
 
 checkAuthObserver ($a_username, $a_auth)
 Called after check auth requests. More...
 
 logoutObserver ($a_username, $a_auth)
 Called after logout. More...
 
 supportsCaptchaVerification ()
 Returns whether or not the auth container supports the verification of captchas This should be true for those auth methods, which are available in the default login form. More...
 

Protected Attributes

 $current_container = null
 

Additional Inherited Members

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

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.

References AUTH_LOG_DEBUG, and Auth_Container\log().

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  }
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
log($message, $level=AUTH_LOG_DEBUG)
Log a message to the Auth log.
Definition: Container.php:246
+ Here is the call graph for this function:

◆ failedLoginObserver()

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

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

References AUTH_LOG_DEBUG, and Auth_Container\log().

57  {
58  $this->log('Auth_Container_Multiple: All containers rejected user credentials.', AUTH_LOG_DEBUG);
59  return false;
60  }
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
log($message, $level=AUTH_LOG_DEBUG)
Log a message to the Auth log.
Definition: Container.php:246
+ Here is the call graph for this function:

◆ fetchData()

ilAuthContainerMultiple::fetchData (   $user,
  $pass 
)

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

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

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
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
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.
log($message, $level=AUTH_LOG_DEBUG)
Log a message to the Auth log.
Definition: Container.php:246
static getLogger($a_component_id)
Get component logger.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
Authentication against external SOAP server
$_auth_obj
The Auth object this container is attached to.
Definition: Container.php:56
isError($data, $code=null)
Tell whether a value is a PEAR error.
Definition: PEAR.php:279
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.

References AUTH_LOG_DEBUG, and Auth_Container\log().

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  }
const AUTH_LOG_DEBUG
Auth Log level - DEBUG.
Definition: Auth.php:59
log($message, $level=AUTH_LOG_DEBUG)
Log a message to the Auth log.
Definition: Container.php:246
+ Here is the call graph for this function:

◆ 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: