ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
42 const CONTEXT_CRON = 4;
43
47 const CONTEXT_CAS = 5;
48
54
55
61
62
67 const CONTEXT_ECS = 8;
68
73 const CONTEXT_OPENID = 9;
74
75
80 const CONTEXT_APACHE = 10;
81
85 private static $context = self::CONTEXT_WEB;
86
90 private static $context_options = array();
91
96 public static function getContext()
97 {
98 return self::$context;
99 }
100
106 public static function setContext($a_context)
107 {
108 self::$context = $a_context;
109 }
110
118 public static function setContextOptions($a_context,$a_options)
119 {
120 self::$context_options[$a_context] = $a_options;
121 }
122
127 public static function getContextOptions()
128 {
129 return self::$context_options[$a_context] ?
130 self::$context_options[$a_context] :
131 array();
132 }
133
134
141 public static function factory(ilAuthContainerBase $deco)
142 {
143 $options = self::getContextOptions(self::getContext());
144
145 switch(self::$context)
146 {
148 include_once './Services/Authentication/classes/class.ilAuthWeb.php';
149 return new ilAuthWeb($deco,$options);
150
152 include_once './Services/Authentication/classes/class.ilAuthHTTP.php';
153 return new ilAuthHTTP($deco,$options);
154
156 include_once './Services/WebServices/SOAP/classes/class.ilAuthSOAP.php';
157 return new ilAuthSOAP($deco,$options);
158
160 include_once './Services/CAS/classes/class.ilAuthCAS.php';
161 return new ilAuthCAS($deco,$options);
162
164 include_once './Services/Calendar/classes/class.ilAuthCalendar.php';
165 return new ilAuthCalendar($deco,$options);
166
168 include_once './Services/Calendar/classes/class.ilAuthCalendarToken.php';
169 include_once './Services/Calendar/classes/class.ilAuthContainerCalendarToken.php';
170 // Force token authentication
171 $GLOBALS['ilLog']->write('Calling calendar token');
173
175 include_once './cron/classes/class.ilAuthCron.php';
176 return new ilAuthCron($deco,$options);
177
179 include_once './Services/WebServices/ECS/classes/class.ilAuthECS.php';
180 return new ilAuthECS($deco,$options);
181
183 include_once './Services/OpenId/classes/class.ilAuthOpenId.php';
184 return new ilAuthOpenId($deco,$options);
185
187 include_once './Services/AuthApache/classes/class.ilAuthApache.php';
188 return new ilAuthApache($deco,$options);
189 }
190 }
191}
192?>
@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
Base class for ilAuth, ilAuthHTTP ....
Authentication class for ECS users (access to remote courses)
@classDescription Factory for PEAR Auth frontend classes
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 Open ID auth class
@classDescription Frontend class for SOAP based authentication
@classDescription Web based authentication
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
if(!is_array($argv)) $options