ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAuthFrontendFactory Class Reference

Factory for auth frontend classes. More...

+ Collaboration diagram for ilAuthFrontendFactory:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getLogger ()
 
 setContext ($a_context)
 Set context for following authentication requests. More...
 
 getContext ()
 Get context. More...
 
 getFrontend (ilAuthSession $session, ilAuthStatus $status, ilAuthCredentials $credentials, array $providers)
 

Data Fields

const CONTEXT_UNDEFINED = 0
 
const CONTEXT_STANDARD_FORM = 2
 
const CONTEXT_CLI = 3
 
const CONTEXT_WS = 4
 
const CONTEXT_HTTP = 5
 

Private Attributes

 $context = self::CONTEXT_UNDEFINED
 
 $credentials = null
 
 $logger = null
 

Detailed Description

Factory for auth frontend classes.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 11 of file class.ilAuthFrontendFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthFrontendFactory::__construct ( )

Constructor.

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

References ilLoggerFactory\getLogger().

38  {
39  $this->logger = ilLoggerFactory::getLogger('auth');
40  }
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

Member Function Documentation

◆ getContext()

ilAuthFrontendFactory::getContext ( )

Get context.

Returns
int

Definition at line 64 of file class.ilAuthFrontendFactory.php.

References $context.

Referenced by getFrontend().

+ Here is the caller graph for this function:

◆ getFrontend()

ilAuthFrontendFactory::getFrontend ( ilAuthSession  $session,
ilAuthStatus  $status,
ilAuthCredentials  $credentials,
array  $providers 
)
Returns

Definition at line 72 of file class.ilAuthFrontendFactory.php.

References getContext(), and getLogger().

73  {
74  switch ($this->getContext()) {
75  case self::CONTEXT_CLI:
76  $this->getLogger()->debug('Init auth frontend with standard auth context');
77  include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontendCLI.php';
78  $frontend = new ilAuthFrontendCLI(
79  $session,
80  $status,
81  $credentials,
82  $providers
83  );
84  return $frontend;
85 
86  case self::CONTEXT_WS:
87  $this->getLogger()->debug('Init auth frontend with webservice auth context');
88  include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontendWS.php';
89  $frontend = new ilAuthFrontendWS(
90  $session,
91  $status,
92  $credentials,
93  $providers
94  );
95  return $frontend;
96 
97  case self::CONTEXT_STANDARD_FORM:
98  $this->getLogger()->debug('Init auth frontend with standard auth context');
99  include_once './Services/Authentication/classes/Frontend/class.ilAuthStandardFormFrontend.php';
100  $frontend = new ilAuthStandardFormFrontend(
101  $session,
102  $status,
103  $credentials,
104  $providers
105  );
106  return $frontend;
107 
108  case self::CONTEXT_HTTP:
109  $this->getLogger()->debug('Init auth frontend with http basic auth context');
110  include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontendHTTP.php';
111  $frontend = new ilAuthFrontendHTTP(
112  $session,
113  $status,
114  $credentials,
115  $providers
116  );
117  return $frontend;
118 
119  case self::CONTEXT_UNDEFINED:
120  $this->getLogger()->error('Trying to init auth with empty context');
121  break;
122  }
123  }
Description of class class.
Description of class class.
Auth class for form based authentication.
Description of class class.
+ Here is the call graph for this function:

◆ getLogger()

ilAuthFrontendFactory::getLogger ( )
Returns

Definition at line 46 of file class.ilAuthFrontendFactory.php.

References $logger.

Referenced by getFrontend().

+ Here is the caller graph for this function:

◆ setContext()

ilAuthFrontendFactory::setContext (   $a_context)

Set context for following authentication requests.

Parameters
int$a_context

Definition at line 55 of file class.ilAuthFrontendFactory.php.

56  {
57  $this->context = $a_context;
58  }

Field Documentation

◆ $context

ilAuthFrontendFactory::$context = self::CONTEXT_UNDEFINED
private

Definition at line 29 of file class.ilAuthFrontendFactory.php.

Referenced by getContext().

◆ $credentials

ilAuthFrontendFactory::$credentials = null
private

Definition at line 30 of file class.ilAuthFrontendFactory.php.

◆ $logger

ilAuthFrontendFactory::$logger = null
private

Definition at line 31 of file class.ilAuthFrontendFactory.php.

Referenced by getLogger().

◆ CONTEXT_CLI

const ilAuthFrontendFactory::CONTEXT_CLI = 3

Definition at line 20 of file class.ilAuthFrontendFactory.php.

Referenced by ilCronStartUp\authenticate().

◆ CONTEXT_HTTP

const ilAuthFrontendFactory::CONTEXT_HTTP = 5

◆ CONTEXT_STANDARD_FORM

◆ CONTEXT_UNDEFINED

const ilAuthFrontendFactory::CONTEXT_UNDEFINED = 0

Definition at line 13 of file class.ilAuthFrontendFactory.php.

◆ CONTEXT_WS

const ilAuthFrontendFactory::CONTEXT_WS = 4

Definition at line 23 of file class.ilAuthFrontendFactory.php.


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