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 ";
79 require_once(
'./Services/AuthShibboleth/classes/Config/class.shibConfig.php');
82 $query =
"SELECT rule_id,add_on_update,remove_on_update FROM shib_role_assignment " .
"WHERE add_on_update = 1 OR remove_on_update = 1";
87 if ($rule->doesMatch($a_data) and
$row->add_on_update) {
89 $rbacadmin->assignUser($rule->getRoleId(), $a_usr_id);
91 if (! $rule->doesMatch($a_data) and
$row->remove_on_update) {
93 $rbacadmin->deassignUser($rule->getRoleId(), $a_usr_id);
97 if (! array_intersect($rbacreview->assignedRoles($a_usr_id), $rbacreview->getGlobalRoles())) {
100 $rbacadmin->assignUser($default_role, $a_usr_id);
115 $query =
"SELECT rule_id FROM shib_role_assignment ";
120 if ($rule->doesMatch($a_data)) {
123 $rbacadmin->assignUser($rule->getRoleId(), $a_usr_id);
127 if (! $num_matches) {
130 $rbacadmin->assignUser($default_role, $a_usr_id);
143 public static function callPlugin($a_plugin_id, $a_user_data) {
144 global $ilPluginAdmin;
145 if (self::$active_plugins == NULL) {
146 self::$active_plugins = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
'AuthShibboleth',
'shibhk');
149 foreach (self::$active_plugins as $plugin_name) {
151 $plugin_obj = $ilPluginAdmin->getPluginObject(
IL_COMP_SERVICE,
'AuthShibboleth',
'shibhk', $plugin_name);
153 $ok = $plugin_obj->checkRoleAssignment($a_plugin_id, $a_user_data);