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 
47  const CONTEXT_CALENDAR = 6;
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  {
136  case self::CONTEXT_WEB:
137  include_once './Services/Authentication/classes/class.ilAuthWeb.php';
138  return new ilAuthWeb($deco,$options);
139 
140  case self::CONTEXT_HTTP:
141  include_once './Services/Authentication/classes/class.ilAuthHTTP.php';
142  return new ilAuthHTTP($deco,$options);
143 
144  case self::CONTEXT_SOAP:
145  include_once './Services/WebServices/SOAP/classes/class.ilAuthSOAP.php';
146  return new ilAuthSOAP($deco,$options);
147 
148  case self::CONTEXT_CAS:
149  include_once './Services/CAS/classes/class.ilAuthCAS.php';
150  return new ilAuthCAS($deco,$options);
151 
152  case self::CONTEXT_CALENDAR:
153  include_once './Services/Calendar/classes/class.ilAuthCalendar.php';
154  return new ilAuthCalendar($deco,$options);
155 
156  case self::CONTEXT_CALENDAR_TOKEN:
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 
163  case self::CONTEXT_ECS:
164  include_once './Services/WebServices/ECS/classes/class.ilAuthECS.php';
165  return new ilAuthECS($deco,$options);
166 
167  case self::CONTEXT_APACHE:
168  include_once './Services/AuthApache/classes/class.ilAuthApache.php';
169  return new ilAuthApache($deco,$options);
170  }
171  }
172 }
173 ?>
Class for calendar authentication.
static getContextOptions()
Get options for a specific context.
CAS authentication
static setContextOptions($a_context, $a_options)
set context specific options for later use in factory.
Class for calendar authentication.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Base class for all ILIAS PEAR container classes
Authentication frontend factory.
Base class for ilAuth, ilAuthHTTP ....
Calendar token based authentication
if(!is_array($argv)) $options
Apache based authentication
Frontend class for SOAP based authentication
Authentication class for ECS users (access to remote courses)
static setContext($a_context)
set context
Web based authentication
Create styles array
The data for the language used.
static factory(ilAuthContainerBase $deco)
The factory.