ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilShibbolethPluginWrapper.php
Go to the documentation of this file.
1<?php
2require_once('./Services/AuthShibboleth/interfaces/interface.ilShibbolethAuthenticationPluginInt.php');
3
10{
11
15 protected $plugin_admin;
19 protected $log;
23 protected static $active_plugins = array();
27 protected static $cache = null;
28
29
30 protected function __construct()
31 {
32 global $DIC;
33 $ilPluginAdmin = $DIC['ilPluginAdmin'];
34 $ilLog = $DIC['ilLog'];
35 $this->log = $ilLog;
36 $this->plugin_admin = $ilPluginAdmin;
37 if (self::$active_plugins == null) {
38 self::$active_plugins = $this->plugin_admin->getActivePluginsForSlot(IL_COMP_SERVICE, 'AuthShibboleth', 'shibhk');
39 }
40 }
41
42
46 public static function getInstance()
47 {
48 if (!self::$cache instanceof ilShibbolethPluginWrapper) {
49 self::$cache = new self();
50 }
51
52 return self::$cache;
53 }
54
55
59 protected function getPluginObjects()
60 {
61 $plugin_objs = array();
62 foreach (self::$active_plugins as $plugin_name) {
63 $plugin_obj = $this->plugin_admin->getPluginObject(IL_COMP_SERVICE, 'AuthShibboleth', 'shibhk', $plugin_name);
64 if ($plugin_obj instanceof ilShibbolethAuthenticationPlugin) {
65 $plugin_objs[] = $plugin_obj;
66 }
67 }
68
69 return $plugin_objs;
70 }
71
72
78 public function beforeLogin(ilObjUser $user)
79 {
80 foreach ($this->getPluginObjects() as $pl) {
81 $user = $pl->beforeLogin($user);
82 }
83
84 return $user;
85 }
86
87
93 public function afterLogin(ilObjUser $user)
94 {
95 foreach ($this->getPluginObjects() as $pl) {
96 $user = $pl->afterLogin($user);
97 }
98
99 return $user;
100 }
101
102
109 {
110 foreach ($this->getPluginObjects() as $pl) {
111 $user = $pl->beforeCreateUser($user);
112 }
113
114 return $user;
115 }
116
117
124 {
125 foreach ($this->getPluginObjects() as $pl) {
126 $user = $pl->afterCreateUser($user);
127 }
128
129 return $user;
130 }
131
132
133 public function beforeLogout(ilObjUser $user)
134 {
135 foreach ($this->getPluginObjects() as $pl) {
136 $user = $pl->beforeLogout($user);
137 }
138
139 return $user;
140 }
141
142
148 public function afterLogout(ilObjUser $user)
149 {
150 $this->log->write('afterlogout');
151 foreach ($this->getPluginObjects() as $pl) {
152 $user = $pl->afterLogout($user);
153 }
154
155 return $user;
156 }
157
158
165 {
166 foreach ($this->getPluginObjects() as $pl) {
167 $user = $pl->beforeUpdateUser($user);
168 }
169
170 return $user;
171 }
172
173
180 {
181 foreach ($this->getPluginObjects() as $pl) {
182 $user = $pl->afterUpdateUser($user);
183 }
184
185 return $user;
186 }
187}
An exception for terminatinating execution or to throw for unit testing.
const IL_COMP_SERVICE
Class ilShibbolethPluginWrapper.
$user
Definition: migrateto20.php:57
global $DIC
Definition: saml.php:7