ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilUserCreationContext.php
Go to the documentation of this file.
1 <?php
2 
23 {
24  public const CONTEXT_REGISTRATION = 1;
25  public const CONTEXT_ADMINISTRATION = 2;
26  public const CONTEXT_SOAP = 3;
27  public const CONTEXT_LDAP = 4;
28  public const CONTEXT_SHIB = 6;
29 
30  private static ?ilUserCreationContext $instance = null;
31  private array $contexts = array(); // Missing array type.
32 
33  protected function __construct()
34  {
35  }
36 
37  public static function getInstance(): self
38  {
39  if (!self::$instance) {
40  self::$instance = new self();
41  }
42  return self::$instance;
43  }
44 
45  public function getValidContexts(): array // Missing array type.
46  {
47  return array(
48  self::CONTEXT_REGISTRATION,
49  self::CONTEXT_ADMINISTRATION,
50  self::CONTEXT_SOAP,
51  self::CONTEXT_LDAP,
52  self::CONTEXT_SHIB
53  );
54  }
55 
56  public function getCurrentContexts(): array // Missing array type.
57  {
58  return $this->contexts;
59  }
60 
61  public function addContext(int $a_context): void
62  {
63  if (in_array($a_context, $this->getValidContexts())) {
64  if (!in_array($a_context, $this->getCurrentContexts())) {
65  $this->contexts[] = $a_context;
66  }
67  }
68  }
69 }
static ilUserCreationContext $instance
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...