ILIAS  release_8 Revision v8.24
ilAuthFrontendFactory Class Reference

Factory for auth frontend classes. More...

+ Collaboration diagram for ilAuthFrontendFactory:

Public Member Functions

 __construct ()
 Constructor. More...
 
 setContext (int $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_STANDARD_FORM = 2
 
const CONTEXT_CLI = 3
 
const CONTEXT_WS = 4
 
const CONTEXT_HTTP = 5
 

Private Attributes

const CONTEXT_UNDEFINED = 0
 
int $context = self::CONTEXT_UNDEFINED
 
ilLogger $logger
 

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 27 of file class.ilAuthFrontendFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthFrontendFactory::__construct ( )

Constructor.

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

53 {
54 global $DIC;
55 $this->logger = $DIC->logger()->auth();
56 }
global $DIC
Definition: feed.php:28

References $DIC, and ILIAS\Repository\logger().

+ Here is the call graph for this function:

Member Function Documentation

◆ getContext()

ilAuthFrontendFactory::getContext ( )

Get context.

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

69 : int
70 {
71 return $this->context;
72 }

References $context.

Referenced by getFrontend().

+ Here is the caller graph for this function:

◆ getFrontend()

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

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

75 {
76 switch ($this->getContext()) {
78 $this->logger->debug('Init auth frontend with standard auth context');
79 $frontend = new ilAuthFrontendCLI(
81 $status,
82 $credentials,
83 $providers
84 );
85 return $frontend;
86
88 $this->logger->debug('Init auth frontend with webservice auth context');
89 $frontend = new ilAuthFrontendWS(
91 $status,
92 $credentials,
93 $providers
94 );
95 return $frontend;
96
98 $this->logger->debug('Init auth frontend with standard auth context');
99 $frontend = new ilAuthStandardFormFrontend(
100 $session,
101 $status,
102 $credentials,
103 $providers
104 );
105 return $frontend;
106
108 $this->logger->debug('Init auth frontend with http basic auth context');
109 $frontend = new ilAuthFrontendHTTP(
110 $session,
111 $status,
112 $credentials,
113 $providers
114 );
115 return $frontend;
116
118 $this->logger->error('Trying to init auth with empty context');
119 break;
120 }
121 return null;
122 }
Auth class for form based authentication.
Interface for auth methods (web form, http, ...)
$session

References $session, CONTEXT_CLI, CONTEXT_HTTP, CONTEXT_STANDARD_FORM, CONTEXT_UNDEFINED, CONTEXT_WS, getContext(), and ILIAS\Repository\logger().

+ Here is the call graph for this function:

◆ setContext()

ilAuthFrontendFactory::setContext ( int  $a_context)

Set context for following authentication requests.

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

61 : void
62 {
63 $this->context = $a_context;
64 }

Field Documentation

◆ $context

int ilAuthFrontendFactory::$context = self::CONTEXT_UNDEFINED
private

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

Referenced by getContext().

◆ $logger

ilLogger ilAuthFrontendFactory::$logger
private

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

◆ CONTEXT_CLI

const ilAuthFrontendFactory::CONTEXT_CLI = 3

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

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

◆ CONTEXT_HTTP

const ilAuthFrontendFactory::CONTEXT_HTTP = 5

◆ CONTEXT_STANDARD_FORM

◆ CONTEXT_UNDEFINED

const ilAuthFrontendFactory::CONTEXT_UNDEFINED = 0
private

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

Referenced by getFrontend().

◆ CONTEXT_WS

const ilAuthFrontendFactory::CONTEXT_WS = 4

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

Referenced by getFrontend(), and ilSoapUserAdministration\login().


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