ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilAuthFactory.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
15{
20 const CONTEXT_WEB = 1;
21
29 const CONTEXT_HTTP = 2;
30
31
36 const CONTEXT_SOAP = 3;
37
41 const CONTEXT_CAS = 5;
42
48
49
55
56
61 const CONTEXT_ECS = 8;
62
63
64
69 const CONTEXT_APACHE = 10;
70
74 private static $context = self::CONTEXT_WEB;
75
79 private static $context_options = array();
80
85 public static function getContext()
86 {
87 return self::$context;
88 }
89
95 public static function setContext($a_context)
96 {
97 self::$context = $a_context;
98 }
99
107 public static function setContextOptions($a_context, $a_options)
108 {
109 self::$context_options[$a_context] = $a_options;
110 }
111
116 public static function getContextOptions()
117 {
118 return self::$context_options[$a_context] ?
119 self::$context_options[$a_context] :
120 array();
121 }
122
123
130 public static function factory(ilAuthContainerBase $deco)
131 {
132 $options = self::getContextOptions(self::getContext());
133
134 switch (self::$context) {
136 include_once './Services/Authentication/classes/class.ilAuthWeb.php';
137 return new ilAuthWeb($deco, $options);
138
140 include_once './Services/Authentication/classes/class.ilAuthHTTP.php';
141 return new ilAuthHTTP($deco, $options);
142
144 include_once './Services/WebServices/SOAP/classes/class.ilAuthSOAP.php';
145 return new ilAuthSOAP($deco, $options);
146
148 include_once './Services/CAS/classes/class.ilAuthCAS.php';
149 return new ilAuthCAS($deco, $options);
150
152 include_once './Services/Calendar/classes/class.ilAuthCalendar.php';
153 return new ilAuthCalendar($deco, $options);
154
156 include_once './Services/Calendar/classes/class.ilAuthCalendarToken.php';
157 include_once './Services/Calendar/classes/class.ilAuthContainerCalendarToken.php';
158 // Force token authentication
159 $GLOBALS['ilLog']->write('Calling calendar token');
161
163 include_once './Services/WebServices/ECS/classes/class.ilAuthECS.php';
164 return new ilAuthECS($deco, $options);
165
167 include_once './Services/AuthApache/classes/class.ilAuthApache.php';
168 return new ilAuthApache($deco, $options);
169 }
170 }
171}
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
An exception for terminatinating execution or to throw for unit testing.
@classDescription Apache based authentication
@classDescription CAS authentication
Class for calendar authentication.
Class for calendar authentication.
@classDescription Base class for all ILIAS PEAR container classes
@classDescription Calendar token based authentication
Authentication class for ECS users (access to remote courses)
Authentication frontend factory.
static factory(ilAuthContainerBase $deco)
The factory.
static getContextOptions()
Get options for a specific context.
static setContextOptions($a_context, $a_options)
set context specific options for later use in factory.
static setContext($a_context)
set context
Base class for ilAuth, ilAuthHTTP ....
@classDescription Frontend class for SOAP based authentication
@classDescription Web based authentication
$GLOBALS['loaded']
Global hash that tracks already loaded includes.