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 
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  case self::CONTEXT_WEB:
136  include_once './Services/Authentication/classes/class.ilAuthWeb.php';
137  return new ilAuthWeb($deco, $options);
138 
139  case self::CONTEXT_HTTP:
140  include_once './Services/Authentication/classes/class.ilAuthHTTP.php';
141  return new ilAuthHTTP($deco, $options);
142 
143  case self::CONTEXT_SOAP:
144  include_once './Services/WebServices/SOAP/classes/class.ilAuthSOAP.php';
145  return new ilAuthSOAP($deco, $options);
146 
147  case self::CONTEXT_CAS:
148  include_once './Services/CAS/classes/class.ilAuthCAS.php';
149  return new ilAuthCAS($deco, $options);
150 
151  case self::CONTEXT_CALENDAR:
152  include_once './Services/Calendar/classes/class.ilAuthCalendar.php';
153  return new ilAuthCalendar($deco, $options);
154 
155  case self::CONTEXT_CALENDAR_TOKEN:
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 
162  case self::CONTEXT_ECS:
163  include_once './Services/WebServices/ECS/classes/class.ilAuthECS.php';
164  return new ilAuthECS($deco, $options);
165 
166  case self::CONTEXT_APACHE:
167  include_once './Services/AuthApache/classes/class.ilAuthApache.php';
168  return new ilAuthApache($deco, $options);
169  }
170  }
171 }
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
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.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20