47                 if(self::$default_role)
 
   52                 include_once 
'./Services/LDAP/classes/class.ilLDAPAttributeMapping.php';
 
   53                 include_once 
'./Services/LDAP/classes/class.ilLDAPServer.php';
 
   55                 return self::$default_role = 
 
   67                 $query = 
"SELECT DISTINCT(role_id) FROM ldap_role_assignments ";
 
   71                         $roles[
$row->role_id] = 
$row->role_id;
 
   75                 return $roles ? $roles : array();
 
   86                 $query = 
"SELECT DISTINCT(att_name) ".
 
   87                         "FROM ldap_role_assignments ";
 
   91                         $name = strtolower(trim(
$row->att_name));
 
   98                 $names = array_merge((array) $names, self::getAdditionalPluginAttributes());    
 
   99                 return $names ? $names : array();
 
  108                 $query = 
"SELECT rule_id,add_on_update,remove_on_update FROM ldap_role_assignments ".
 
  109                         "WHERE add_on_update = 1 OR remove_on_update = 1";
 
  115                         include_once 
'./Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php';
 
  118                         $matches = $rule->matches($a_usr_data);
 
  119                         if($matches and 
$row->add_on_update)
 
  121                                 $ilLog->write(__METHOD__.
': Assigned to role: '.$a_usr_name.
' => '.
ilObject::_lookupTitle($rule->getRoleId()));
 
  125                         if(!$matches and 
$row->remove_on_update)
 
  127                                 $ilLog->write(__METHOD__.
': Deassigned from role: '.$a_usr_name.
' => '.
ilObject::_lookupTitle($rule->getRoleId()));
 
  133                 $deassigned_global = 0;
 
  134                 foreach($roles as $role_data)
 
  136                         if($role_data[
'type'] == 
'Global' and
 
  137                                 $role_data[
'action'] == self::ROLE_ACTION_DEASSIGN)
 
  139                                 $deassigned_global++;
 
  142                 if(count($rbacreview->assignedGlobalRoles($a_usr_id)) == $deassigned_global)
 
  144                         $ilLog->write(__METHOD__.
': No global role left. Assigning to default role.');
 
  146                                 self::getDefaultRole(),
 
  147                                 self::ROLE_ACTION_ASSIGN
 
  151                 return $roles ? $roles : array();
 
  169                 $query = 
"SELECT rule_id FROM ldap_role_assignments ";
 
  176                         include_once 
'./Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php';
 
  179                         if($rule->matches($a_usr_data))
 
  182                                 $ilLog->write(__METHOD__.
': Assigned to role: '.$a_usr_name.
' => '.
ilObject::_lookupTitle($rule->getRoleId()));
 
  188                 $found_global = 
false;
 
  189                 foreach($roles as $role_data)
 
  191                         if($role_data[
'type'] == 
'Global')
 
  193                                 $found_global = 
true;
 
  199                         $ilLog->write(__METHOD__.
': No matching rule found. Assigning to default role.');
 
  201                                 self::getDefaultRole(),
 
  202                                 self::ROLE_ACTION_ASSIGN
 
  206                 return $roles ? $roles : array();
 
  218                 global $ilPluginAdmin;
 
  220                 if(self::$active_plugins == null)
 
  222                         self::$active_plugins = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
 
  228                 foreach(self::$active_plugins as $plugin_name)
 
  238                                 $ok = $plugin_obj->checkRoleAssignment($a_plugin_id,$a_user_data);
 
  255                 global $ilPluginAdmin;
 
  257                 if(self::$active_plugins == null)
 
  259                         self::$active_plugins = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
 
  264                 $attributes = array();
 
  265                 foreach(self::$active_plugins as $plugin_name)
 
  275                                 $attributes = array_merge($attributes,$plugin_obj->getAdditionalAttributeNames());
 
  278                 return $attributes ? $attributes : array();
 
  288         protected static function parseRole($a_role_id,$a_action)
 
  294                         'type'          => $rbacreview->isGlobalRole($a_role_id) ? 
'Global' : 
'Local',
 
  295                         'action'        => $a_action