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)
 
  122                                $roles[] = 
self::parseRole($rule->getRoleId(), self::ROLE_ACTION_ASSIGN);
 
  125                        if(!$matches and 
$row->remove_on_update)
 
  128                                $roles[] = 
self::parseRole($rule->getRoleId(), self::ROLE_ACTION_DEASSIGN);
 
  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))
 
  183                                $roles[] = 
self::parseRole($rule->getRoleId(),self::ROLE_ACTION_ASSIGN);
 
  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
 
const DB_FETCHMODE_OBJECT
static _lookupGlobalRole($a_server_id)
Lookup global role assignment.
static _getInstanceByRuleId($a_rule_id)
get instance by rule id
@classDescription Do role assignemnts
static getAttributeNames()
get all possible attribute names
static getAdditionalPluginAttributes()
Fetch additional attributes from plugin.
static getDefaultRole()
Get default global role.
static getAssignmentsForCreation($a_usr_name, $a_usr_data)
static parseRole($a_role_id, $a_action)
Parse role.
static callPlugin($a_plugin_id, $a_user_data)
Call plugin check if the condition matches.
static getAssignmentsForUpdate($a_usr_id, $a_usr_name, $a_usr_data)
const ROLE_ACTION_DEASSIGN
static getAllPossibleRoles()
Get all assignable roles (used for import parser)
static _getFirstActiveServer()
Get first active server.
static _lookupTitle($a_id)
lookup object title
Interface for ldap role assignment plugins.