ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilShibbolethPluginWrapper.php
Go to the documentation of this file.
1<?php
2require_once('./Services/AuthShibboleth/interfaces/interface.ilShibbolethAuthenticationPluginInt.php');
3
10
14 protected $plugin_admin;
18 protected $log;
22 protected static $active_plugins = array();
26 protected static $cache = NULL;
27
28
29 protected function __construct() {
30 global $DIC;
31 $ilPluginAdmin = $DIC['ilPluginAdmin'];
32 $ilLog = $DIC['ilLog'];
33 $this->log = $ilLog;
34 $this->plugin_admin = $ilPluginAdmin;
35 if (self::$active_plugins == NULL) {
36 self::$active_plugins = $this->plugin_admin->getActivePluginsForSlot(IL_COMP_SERVICE, 'AuthShibboleth', 'shibhk');
37 }
38 }
39
40
44 public static function getInstance() {
45 if (! self::$cache instanceof ilShibbolethPluginWrapper) {
46 self::$cache = new self();
47 }
48
49 return self::$cache;
50 }
51
52
56 protected function getPluginObjects() {
57 $plugin_objs = array();
58 foreach (self::$active_plugins as $plugin_name) {
59 $plugin_obj = $this->plugin_admin->getPluginObject(IL_COMP_SERVICE, 'AuthShibboleth', 'shibhk', $plugin_name);
60 if ($plugin_obj instanceof ilShibbolethAuthenticationPlugin) {
61 $plugin_objs[] = $plugin_obj;
62 }
63 }
64
65 return $plugin_objs;
66 }
67
68
74 public function beforeLogin(ilObjUser $user) {
75 foreach ($this->getPluginObjects() as $pl) {
76 $user = $pl->beforeLogin($user);
77 }
78
79 return $user;
80 }
81
82
88 public function afterLogin(ilObjUser $user) {
89 foreach ($this->getPluginObjects() as $pl) {
90 $user = $pl->afterLogin($user);
91 }
92
93 return $user;
94 }
95
96
102 public function beforeCreateUser(ilObjUser $user) {
103 foreach ($this->getPluginObjects() as $pl) {
104 $user = $pl->beforeCreateUser($user);
105 }
106
107 return $user;
108 }
109
110
116 public function afterCreateUser(ilObjUser $user) {
117 foreach ($this->getPluginObjects() as $pl) {
118 $user = $pl->afterCreateUser($user);
119 }
120
121 return $user;
122 }
123
124
125 public function beforeLogout(ilObjUser $user) {
126 foreach ($this->getPluginObjects() as $pl) {
127 $user = $pl->beforeLogout($user);
128 }
129
130 return $user;
131 }
132
133
139 public function afterLogout(ilObjUser $user) {
140 $this->log->write('afterlogout');
141 foreach ($this->getPluginObjects() as $pl) {
142 $user = $pl->afterLogout($user);
143 }
144
145 return $user;
146 }
147
148
154 public function beforeUpdateUser(ilObjUser $user) {
155 foreach ($this->getPluginObjects() as $pl) {
156 $user = $pl->beforeUpdateUser($user);
157 }
158
159 return $user;
160 }
161
162
168 public function afterUpdateUser(ilObjUser $user) {
169 foreach ($this->getPluginObjects() as $pl) {
170 $user = $pl->afterUpdateUser($user);
171 }
172
173 return $user;
174 }
175}
176
177?>
An exception for terminatinating execution or to throw for unit testing.
const IL_COMP_SERVICE
Class ilShibbolethPluginWrapper.
global $DIC