ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)
135 {
137 include_once './Services/Authentication/classes/class.ilAuthWeb.php';
138 return new ilAuthWeb($deco,$options);
139
141 include_once './Services/Authentication/classes/class.ilAuthHTTP.php';
142 return new ilAuthHTTP($deco,$options);
143
145 include_once './Services/WebServices/SOAP/classes/class.ilAuthSOAP.php';
146 return new ilAuthSOAP($deco,$options);
147
149 include_once './Services/CAS/classes/class.ilAuthCAS.php';
150 return new ilAuthCAS($deco,$options);
151
153 include_once './Services/Calendar/classes/class.ilAuthCalendar.php';
154 return new ilAuthCalendar($deco,$options);
155
157 include_once './Services/Calendar/classes/class.ilAuthCalendarToken.php';
158 include_once './Services/Calendar/classes/class.ilAuthContainerCalendarToken.php';
159 // Force token authentication
160 $GLOBALS['ilLog']->write('Calling calendar token');
162
164 include_once './Services/WebServices/ECS/classes/class.ilAuthECS.php';
165 return new ilAuthECS($deco,$options);
166
168 include_once './Services/AuthApache/classes/class.ilAuthApache.php';
169 return new ilAuthApache($deco,$options);
170 }
171 }
172}
173?>
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.
if(!is_array($argv)) $options