ILIAS  release_7 Revision v7.30-3-g800a261c036
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.

38 {
39 $this->logger = ilLoggerFactory::getLogger('auth');
40 }
static getLogger($a_component_id)
Get component logger.

References ilLoggerFactory\getLogger().

+ 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
\ilAuthFrontendInterface

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

73 {
74 switch ($this->getContext()) {
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(
80 $status,
82 $providers
83 );
84 return $frontend;
85
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(
91 $status,
93 $providers
94 );
95 return $frontend;
96
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,
104 $providers
105 );
106 return $frontend;
107
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,
115 $providers
116 );
117 return $frontend;
118
120 $this->getLogger()->error('Trying to init auth with empty context');
121 break;
122 }
123 }
Description of class class.
Description of class class.
Description of class class.
Auth class for form based authentication.
$session

References $credentials, $session, CONTEXT_CLI, CONTEXT_HTTP, CONTEXT_STANDARD_FORM, CONTEXT_UNDEFINED, CONTEXT_WS, getContext(), and getLogger().

+ Here is the call graph for this function:

◆ getLogger()

ilAuthFrontendFactory::getLogger ( )
Returns
\ilLogger

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.

Referenced by getFrontend().

◆ $logger

ilAuthFrontendFactory::$logger = null
private

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

Referenced by getLogger().

◆ CONTEXT_CLI

const ilAuthFrontendFactory::CONTEXT_CLI = 3

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

Referenced by getFrontend().

◆ CONTEXT_WS

const ilAuthFrontendFactory::CONTEXT_WS = 4

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

Referenced by getFrontend().


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