52 $this->rule_id = $a_id;
66 if(isset(self::$instances[$a_rule_id]))
68 return self::$instances[$a_rule_id];
84 $query =
"SELECT rule_id FROM ldap_role_assignments ";
85 $res = $ilDB->query($query);
90 return $rules ? $rules : array();
102 $this->role_id = $a_role_id;
113 return $this->role_id;
124 return $this->rule_id;
136 $this->server_id = $a_id;
147 return $this->server_id;
159 $this->type = $a_type;
206 $this->member_attribute = $a_attribute;
217 return $this->member_attribute;
229 $this->member_is_dn = $a_status;
240 return (
bool) $this->member_is_dn;
252 $this->attribute_name = $a_name;
263 return $this->attribute_name;
275 $this->attribute_value = $a_value;
286 return $this->attribute_value;
299 case self::TYPE_GROUP:
300 $dn_arr = explode(
',',$this->
getDN());
304 case self::TYPE_ATTRIBUTE:
319 $query =
"INSERT INTO ldap_role_assignments ".
320 "SET server_id = ".$this->db->quote($this->
getServerId()).
", ".
321 "type = ".$this->db->quote($this->
getType()).
", ".
322 "dn = ".$this->db->quote($this->
getDN()).
", ".
327 "role_id = ".(int) $this->
getRoleId().
" ";
328 $res = $this->db->query($query);
330 $this->rule_id = $this->db->getLastInsertId();
342 $query =
"UPDATE ldap_role_assignments ".
343 "SET server_id = ".$this->db->quote($this->
getServerId()).
", ".
344 "type = ".$this->db->quote($this->
getType()).
", ".
345 "dn = ".$this->db->quote($this->
getDN()).
", ".
350 "role_id = ".(int) $this->
getRoleId().
" ".
351 "WHERE rule_id = ".$this->db->quote($this->
getRuleId()).
" ";
353 $res = $this->db->query($query);
355 $this->rule_id = $this->db->getLastInsertId();
369 $ilErr->setMessage(
'');
373 $ilErr->setMessage(
'fill_out_all_required_fields');
378 case self::TYPE_GROUP:
381 $ilErr->setMessage(
'fill_out_all_required_fields');
385 case self::TYPE_ATTRIBUTE:
388 $ilErr->setMessage(
'fill_out_all_required_fields');
394 $ilErr->setMessage(
'ldap_no_type_given');
406 public function delete()
408 $query =
"DELETE FROM ldap_role_assignments ".
409 "WHERE rule_id = ".$this->db->quote($this->
getRuleId()).
" ";
410 $this->db->query($query);
422 $query =
"SELECT * FROM ldap_role_assignments ".
423 "WHERE rule_id = ".$this->db->quote($this->
getRuleId()).
" ";
425 $res = $this->db->query($query);
430 $this->
setDN($row->dn);