24 include_once
'./Services/AuthShibboleth/classes/class.ilShibbolethRoleAssignmentRule.php';
44 public static function getAllRules() {
50 $query =
"SELECT rule_id FROM shib_role_assignment ORDER BY rule_id";
62 $query =
"SELECT COUNT(*) num FROM shib_role_assignment ";
80 $query =
"SELECT rule_id,add_on_update,remove_on_update FROM shib_role_assignment " .
"WHERE add_on_update = 1 OR remove_on_update = 1";
84 $matches = $rule->matches($a_data);
85 if ($matches and
$row->add_on_update) {
87 $rbacadmin->assignUser($rule->getRoleId(), $a_usr_id);
89 if (! $matches and
$row->remove_on_update) {
91 $rbacadmin->deassignUser($rule->getRoleId(), $a_usr_id);
95 if (! array_intersect($rbacreview->assignedRoles($a_usr_id), $rbacreview->getGlobalRoles())) {
96 $ilLog->write(__METHOD__ .
': Assigned to default role '
98 $rbacadmin->assignUser($ilSetting->get(
'shib_user_default_role'), $a_usr_id);
113 $query =
"SELECT rule_id FROM shib_role_assignment ";
118 if ($rule->matches($a_data)) {
121 $rbacadmin->assignUser($rule->getRoleId(), $a_usr_id);
125 if (! $num_matches) {
126 $ilLog->write(__METHOD__ .
': Assigned to default role '
128 $rbacadmin->assignUser($ilSetting->get(
'shib_user_default_role'), $a_usr_id);
141 public static function callPlugin($a_plugin_id, $a_user_data) {
142 global $ilPluginAdmin;
143 if (self::$active_plugins == NULL) {
144 self::$active_plugins = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
'AuthShibboleth',
'shibhk');
147 foreach (self::$active_plugins as $plugin_name) {
149 $plugin_obj = $ilPluginAdmin->getPluginObject(
IL_COMP_SERVICE,
'AuthShibboleth',
'shibhk', $plugin_name);
151 $ok = $plugin_obj->checkRoleAssignment($a_plugin_id, $a_user_data);