60                $this->rule_id = $a_id;
 
   74                if(isset(self::$instances[$a_rule_id]))
 
   76                        return self::$instances[$a_rule_id];
 
   89                $query = 
'SELECT COUNT(*) num FROM ldap_role_assignments '.
 
   90                        'WHERE add_on_update = 1 '.
 
   91                        'OR remove_on_update = 1 ';
 
  109                                include_once 
'./Services/LDAP/classes/class.ilLDAPRoleAssignmentRules.php';
 
  116                                if(!isset($a_user_data[$attn]))
 
  121                                if(!is_array($a_user_data[$attn]))
 
  123                                        $attribute_val = array(0 => $a_user_data[$attn]);
 
  127                                        $attribute_val = $a_user_data[$attn];
 
  130                                foreach($attribute_val as $value)
 
  155                $pattern = str_replace(
'*',
'.*?', $a_str1);
 
  156                $GLOBALS[
'ilLog']->write(__METHOD__.
': Replace pattern:'. $pattern.
' => '.$a_str2);
 
  157                return (
bool) preg_match(
'/^'.$pattern.
'$/i',$a_str2);
 
  175                        $user_cmp = $a_user_data[
'dn'];
 
  179                        $user_cmp = $a_user_data[
'ilExternalAccount'];
 
  182                include_once(
'Services/LDAP/classes/class.ilLDAPQuery.php');
 
  183                include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
 
  197                        return $res->numRows() ? true : 
false;
 
  201                        $ilLog->write(__METHOD__.
': Caught Exception: '.$e->getMessage());
 
  218                $query = 
"SELECT rule_id FROM ldap_role_assignments ";
 
  224                return $rules ? $rules : array();
 
  236                $this->role_id = $a_role_id;    
 
  247                return $this->role_id;
 
  258                return $this->rule_id;
 
  270                $this->server_id = $a_id;
 
  293                $this->type = $a_type;
 
  340                $this->member_attribute = $a_attribute;
 
  351                return $this->member_attribute;
 
  363                $this->member_is_dn = $a_status;
 
  374                return (
bool) $this->member_is_dn;
 
  386                $this->attribute_name = $a_name;
 
  397                return $this->attribute_name;
 
  409                $this->attribute_value = $a_value;
 
  420                return $this->attribute_value;
 
  425                $this->add_on_update = $a_status;
 
  435                $this->remove_on_update = $a_status;
 
  445                $this->plugin_id = $a_id;
 
  472                                return $lng->txt(
'ldap_plugin_id').
': '.$this->
getPluginId();
 
  475                                $dn_arr = explode(
',',$this->
getDN());
 
  496                $next_id = 
$ilDB->nextId(
'ldap_role_assignments');
 
  498                $query = 
"INSERT INTO ldap_role_assignments (server_id,rule_id,type,dn,attribute,isdn,att_name,att_value,role_id, ".
 
  499                        "add_on_update, remove_on_update, plugin_id ) ".
 
  501                        $this->db->quote($this->
getServerId(),
'integer').
", ".
 
  502                        $this->db->quote($next_id,
'integer').
", ".
 
  503                        $this->db->quote($this->
getType(),
'integer').
", ".
 
  504                        $this->db->quote($this->
getDN(),
'text').
", ".
 
  509                        $this->db->quote($this->
getRoleId(),
'integer').
", ".
 
  512                        $this->db->quote($this->
getPluginId(),
'integer').
' '.
 
  515                $this->rule_id = $next_id;
 
  530                $query = 
"UPDATE ldap_role_assignments ".
 
  531                        "SET server_id = ".$this->db->quote($this->
getServerId(),
'integer').
", ".
 
  532                        "type = ".$this->db->quote($this->
getType(),
'integer').
", ".
 
  533                        "dn = ".$this->db->quote($this->
getDN(),
'text').
", ".
 
  538                        "role_id = ".$this->db->quote($this->
getRoleId(),
'integer').
", ".
 
  541                        'plugin_id = '.$this->db->quote($this->
getPluginId(),
'integer').
' '.
 
  542                        "WHERE rule_id = ".$this->db->quote($this->
getRuleId(),
'integer').
" ";
 
  561                        $ilErr->setMessage(
'fill_out_all_required_fields');
 
  569                                        $ilErr->setMessage(
'fill_out_all_required_fields');
 
  576                                        $ilErr->setMessage(
'fill_out_all_required_fields');
 
  584                                        $ilErr->setMessage(
'ldap_err_missing_plugin_id');
 
  590                                $ilErr->setMessage(
'ldap_no_type_given');
 
  602        public function delete()
 
  606                $query = 
"DELETE FROM ldap_role_assignments ".
 
  607                        "WHERE rule_id = ".$this->db->quote($this->
getRuleId(),
'integer').
" ";
 
  622                $query = 
"SELECT * FROM ldap_role_assignments ".
 
  623                        "WHERE rule_id = ".$this->db->quote($this->
getRuleId(),
'integer').
" ";
 
const DB_FETCHMODE_OBJECT
isGroupMember($a_user_data)
Check if user is member of specific group.
getServerId()
get server id
setServerId($a_id)
set server id
wildcardCompare($a_str1, $a_str2)
setMemberAttribute($a_attribute)
@access public
_getRules()
Get all rules.
getAttributeValue()
get atrtibute value
matches($a_user_data)
Check if a rule matches.
setAttributeName($a_name)
set attribute name
getAttributeName()
get attribute name
conditionToString()
condition to string
isMemberAttributeDN()
is member attribute dn
isRemoveOnUpdateEnabled()
static hasRulesForUpdate()
Check if there any rule for updates.
setRoleId($a_role_id)
set role id
static _getInstanceByRuleId($a_rule_id)
get instance by rule id
__construct($a_id=0)
Constructor.
setAttributeValue($a_value)
set attribute value
getMemberAttribute()
get attribute
setMemberIsDN($a_status)
set member attribute is dn
enableRemoveOnUpdate($a_status)
enableAddOnUpdate($a_status)
static callPlugin($a_plugin_id, $a_user_data)
Call plugin check if the condition matches.
static getInstanceByServerId($a_server_id)
static _getFirstActiveServer()
Get first active server.
static _lookupTitle($a_id)
lookup object title