ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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())
75 {
77 $this->getLogger()->debug('Init auth frontend with standard auth context');
78 include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontendCLI.php';
79 $frontend = new ilAuthFrontendCLI(
80 $session,
81 $status,
83 $providers
84 );
85 return $frontend;
86
88 $this->getLogger()->debug('Init auth frontend with webservice auth context');
89 include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontendWS.php';
90 $frontend = new ilAuthFrontendWS(
91 $session,
92 $status,
94 $providers
95 );
96 return $frontend;
97
99 $this->getLogger()->debug('Init auth frontend with standard auth context');
100 include_once './Services/Authentication/classes/Frontend/class.ilAuthStandardFormFrontend.php';
101 $frontend = new ilAuthStandardFormFrontend(
102 $session,
103 $status,
105 $providers
106 );
107 return $frontend;
108
110 $this->getLogger()->debug('Init auth frontend with http basic auth context');
111 include_once './Services/Authentication/classes/Frontend/class.ilAuthFrontendHTTP.php';
112 $frontend = new ilAuthFrontendHTTP(
113 $session,
114 $status,
116 $providers
117 );
118 return $frontend;
119
121 $this->getLogger()->error('Trying to init auth with empty context');
122 break;
123 }
124 }
Description of class class.
Description of class class.
Description of class class.
Auth class for form based authentication.

References $credentials, 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

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

Referenced by ilCronStartUp\authenticate(), and getFrontend().

◆ CONTEXT_HTTP

const ilAuthFrontendFactory::CONTEXT_HTTP = 5

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

Referenced by getFrontend(), and ilDAVServer\tryAuthentication().

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