24 include_once
'./Services/AuthShibboleth/classes/class.ilShibbolethRoleAssignmentRule.php';
43 $query =
"SELECT rule_id FROM shib_role_assignment ORDER BY rule_id";
49 return $rules ? $rules : array();
56 $query =
"SELECT COUNT(*) num FROM shib_role_assignment ";
69 $query =
"SELECT rule_id,add_on_update,remove_on_update FROM shib_role_assignment ".
70 "WHERE add_on_update = 1 OR remove_on_update = 1";
77 $matches = $rule->matches($a_data);
78 if($matches and
$row->add_on_update)
81 $rbacadmin->assignUser($rule->getRoleId(),$a_usr_id);
83 if(!$matches and
$row->remove_on_update)
86 $rbacadmin->deassignUser($rule->getRoleId(),$a_usr_id);
91 if(!array_intersect($rbacreview->assignedRoles($a_usr_id),$rbacreview->getGlobalRoles()))
93 $ilLog->write(__METHOD__.
': Assigned to default role '.
ilObject::_lookupTitle($ilSetting->get(
'shib_user_default_role')));
94 $rbacadmin->assignUser($ilSetting->get(
'shib_user_default_role'),$a_usr_id);
104 $query =
"SELECT rule_id FROM shib_role_assignment ";
111 if($rule->matches($a_data))
115 $rbacadmin->assignUser($rule->getRoleId(),$a_usr_id);
121 $ilLog->write(__METHOD__.
': Assigned to default role '.
ilObject::_lookupTitle($ilSetting->get(
'shib_user_default_role')));
122 $rbacadmin->assignUser($ilSetting->get(
'shib_user_default_role'),$a_usr_id);
129 global $ilPluginAdmin;
131 if(self::$active_plugins == null)
133 self::$active_plugins = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
139 foreach(self::$active_plugins as $plugin_name)
149 $ok = $plugin_obj->checkRoleAssignment($a_plugin_id,$a_user_data);