ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilLDAPRoleAssignmentRule Class Reference
+ Collaboration diagram for ilLDAPRoleAssignmentRule:

Public Member Functions

 matches ($a_user_data)
 Check if a rule matches. More...
 
 setRoleId ($a_role_id)
 set role id More...
 
 getRoleId ()
 get role id More...
 
 getRuleId ()
 get id More...
 
 setServerId ($a_id)
 set server id More...
 
 getServerId ()
 get server id More...
 
 setType ($a_type)
 set type More...
 
 getType ()
 getType More...
 
 setDN ($a_dn)
 set dn More...
 
 getDN ()
 get dn More...
 
 setMemberAttribute ($a_attribute)
 public More...
 
 getMemberAttribute ()
 get attribute More...
 
 setMemberIsDN ($a_status)
 set member attribute is dn More...
 
 isMemberAttributeDN ()
 is member attribute dn More...
 
 setAttributeName ($a_name)
 set attribute name More...
 
 getAttributeName ()
 get attribute name More...
 
 setAttributeValue ($a_value)
 set attribute value More...
 
 getAttributeValue ()
 get atrtibute value More...
 
 enableAddOnUpdate ($a_status)
 
 isAddOnUpdateEnabled ()
 
 enableRemoveOnUpdate ($a_status)
 
 isRemoveOnUpdateEnabled ()
 
 setPluginId ($a_id)
 
 getPluginId ()
 
 isPluginActive ()
 
 conditionToString ()
 condition to string More...
 
 create ()
 create More...
 
 update ()
 update More...
 
 validate ()
 validate More...
 
 delete ()
 delete rule More...
 

Static Public Member Functions

static _getInstanceByRuleId ($a_rule_id)
 get instance by rule id More...
 
static hasRulesForUpdate ()
 Check if there any rule for updates. More...
 
static _getRules ($a_server_id)
 Get all rules. More...
 

Data Fields

const TYPE_GROUP = 1
 
const TYPE_ATTRIBUTE = 2
 
const TYPE_PLUGIN = 3
 

Protected Member Functions

 wildcardCompare ($a_str1, $a_str2)
 

Private Member Functions

 __construct ($a_id=0)
 Constructor. More...
 
 isGroupMember ($a_user_data)
 Check if user is member of specific group. More...
 
 read ()
 load from db More...
 

Private Attributes

 $logger = null
 
 $db = null
 
 $server_id = 0
 
 $plugin_active = false
 
 $add_on_update = false
 
 $remove_on_update = false
 
 $plugin_id = 0
 

Static Private Attributes

static $instances = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLDAPRoleAssignmentRule::__construct (   $a_id = 0)
private

Constructor.

private

Parameters
intrule id

Definition at line 42 of file class.ilLDAPRoleAssignmentRule.php.

References $GLOBALS, and read().

43  {
44  $this->db = $GLOBALS['DIC']->database();
45  $this->logger = $GLOBALS['DIC']->logger()->auth();
46 
47  $this->rule_id = $a_id;
48  $this->read();
49  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstanceByRuleId()

static ilLDAPRoleAssignmentRule::_getInstanceByRuleId (   $a_rule_id)
static

get instance by rule id

public

Parameters
intrule id

Definition at line 59 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by ilLDAPSettingsGUI\confirmDeleteRules(), ilLDAPSettingsGUI\deleteRules(), ilLDAPSettingsGUI\editRoleAssignment(), ilLDAPRoleAssignmentRules\getAssignmentsForCreation(), ilLDAPRoleAssignmentRules\getAssignmentsForUpdate(), ilLDAPSettingsGUI\loadRoleAssignmentRule(), and ilLDAPSettingsGUI\roleAssignments().

60  {
61  if(isset(self::$instances[$a_rule_id]))
62  {
63  return self::$instances[$a_rule_id];
64  }
65  return self::$instances[$a_rule_id] = new ilLDAPRoleAssignmentRule($a_rule_id);
66  }
+ Here is the caller graph for this function:

◆ _getRules()

static ilLDAPRoleAssignmentRule::_getRules (   $a_server_id)
static

Get all rules.

public

Returns
ilLDAPRoleAssignmentRule

Definition at line 189 of file class.ilLDAPRoleAssignmentRule.php.

References $GLOBALS, $ilDB, $query, $res, $row, array, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilLDAPServer\delete(), ilLDAPSettingsGUI\getRoleAssignmentTable(), and ilLDAPSettingsGUI\roleAssignments().

190  {
191  $ilDB = $GLOBALS['DIC']->database();
192 
193  $query = "SELECT rule_id FROM ldap_role_assignments ".
194  "WHERE server_id = ".$ilDB->quote($a_server_id,'integer');
195  $res = $ilDB->query($query);
196  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
197  {
198  $rules[] = self::_getInstanceByRuleId($row->rule_id);
199  }
200  return $rules ? $rules : array();
201  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ conditionToString()

ilLDAPRoleAssignmentRule::conditionToString ( )

condition to string

public

Definition at line 441 of file class.ilLDAPRoleAssignmentRule.php.

References $GLOBALS, $lng, getAttributeName(), getAttributeValue(), getDN(), getPluginId(), and getType().

442  {
443  $lng = $GLOBALS['DIC']->language();
444 
445  switch($this->getType())
446  {
447  case self::TYPE_PLUGIN:
448  return $lng->txt('ldap_plugin_id').': '.$this->getPluginId();
449 
450  case self::TYPE_GROUP:
451  $dn_arr = explode(',',$this->getDN());
452  return $dn_arr[0];
453 
454 
455  case self::TYPE_ATTRIBUTE:
456  return $this->getAttributeName().'='.$this->getAttributeValue();
457  }
458  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ create()

ilLDAPRoleAssignmentRule::create ( )

create

public

Parameters

Definition at line 468 of file class.ilLDAPRoleAssignmentRule.php.

References $db, $ilDB, $query, $res, getAttributeName(), getAttributeValue(), getDN(), getMemberAttribute(), getPluginId(), getRoleId(), getServerId(), getType(), isAddOnUpdateEnabled(), isMemberAttributeDN(), and isRemoveOnUpdateEnabled().

469  {
470  $ilDB = $this->db;
471  $next_id = $ilDB->nextId('ldap_role_assignments');
472 
473  $query = "INSERT INTO ldap_role_assignments (server_id,rule_id,type,dn,attribute,isdn,att_name,att_value,role_id, ".
474  "add_on_update, remove_on_update, plugin_id ) ".
475  "VALUES( ".
476  $this->db->quote($this->getServerId(),'integer').", ".
477  $this->db->quote($next_id,'integer').", ".
478  $this->db->quote($this->getType(),'integer').", ".
479  $this->db->quote($this->getDN(),'text').", ".
480  $this->db->quote($this->getMemberAttribute(),'text').", ".
481  $this->db->quote($this->isMemberAttributeDN(),'integer').", ".
482  $this->db->quote($this->getAttributeName(),'text').", ".
483  $this->db->quote($this->getAttributeValue(),'text').", ".
484  $this->db->quote($this->getRoleId(),'integer').", ".
485  $this->db->quote($this->isAddOnUpdateEnabled(), 'integer').', '.
486  $this->db->quote($this->isRemoveOnUpdateEnabled(), 'integer').', '.
487  $this->db->quote($this->getPluginId(),'integer').' '.
488  ")";
489  $res = $ilDB->manipulate($query);
490  $this->rule_id = $next_id;
491 
492  return true;
493  }
isMemberAttributeDN()
is member attribute dn
global $ilDB
+ Here is the call graph for this function:

◆ delete()

ilLDAPRoleAssignmentRule::delete ( )

delete rule

public

Definition at line 577 of file class.ilLDAPRoleAssignmentRule.php.

References $db, $ilDB, $query, $res, and getRuleId().

578  {
579  $ilDB = $this->db;
580 
581  $query = "DELETE FROM ldap_role_assignments ".
582  "WHERE rule_id = ".$this->db->quote($this->getRuleId(),'integer')." ";
583  $res = $ilDB->manipulate($query);
584  return true;
585 
586  }
global $ilDB
+ Here is the call graph for this function:

◆ enableAddOnUpdate()

ilLDAPRoleAssignmentRule::enableAddOnUpdate (   $a_status)

Definition at line 399 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by read().

400  {
401  $this->add_on_update = $a_status;
402  }
+ Here is the caller graph for this function:

◆ enableRemoveOnUpdate()

ilLDAPRoleAssignmentRule::enableRemoveOnUpdate (   $a_status)

Definition at line 409 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by read().

410  {
411  $this->remove_on_update = $a_status;
412  }
+ Here is the caller graph for this function:

◆ getAttributeName()

ilLDAPRoleAssignmentRule::getAttributeName ( )

get attribute name

public

Definition at line 371 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by conditionToString(), create(), matches(), update(), and validate().

372  {
373  return $this->attribute_name;
374  }
+ Here is the caller graph for this function:

◆ getAttributeValue()

ilLDAPRoleAssignmentRule::getAttributeValue ( )

get atrtibute value

public

Definition at line 394 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by conditionToString(), create(), matches(), update(), and validate().

395  {
396  return $this->attribute_value;
397  }
+ Here is the caller graph for this function:

◆ getDN()

ilLDAPRoleAssignmentRule::getDN ( )

get dn

public

Definition at line 302 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by conditionToString(), create(), isGroupMember(), update(), and validate().

303  {
304  return $this->dn;
305  }
+ Here is the caller graph for this function:

◆ getMemberAttribute()

ilLDAPRoleAssignmentRule::getMemberAttribute ( )

get attribute

public

Definition at line 325 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by create(), isGroupMember(), update(), and validate().

326  {
327  return $this->member_attribute;
328  }
+ Here is the caller graph for this function:

◆ getPluginId()

ilLDAPRoleAssignmentRule::getPluginId ( )

Definition at line 424 of file class.ilLDAPRoleAssignmentRule.php.

References $plugin_id.

Referenced by conditionToString(), create(), matches(), update(), and validate().

+ Here is the caller graph for this function:

◆ getRoleId()

ilLDAPRoleAssignmentRule::getRoleId ( )

get role id

public

Definition at line 221 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by create(), matches(), update(), and validate().

222  {
223  return $this->role_id;
224  }
+ Here is the caller graph for this function:

◆ getRuleId()

ilLDAPRoleAssignmentRule::getRuleId ( )

get id

public

Definition at line 232 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by delete(), read(), and update().

233  {
234  return $this->rule_id;
235  }
+ Here is the caller graph for this function:

◆ getServerId()

ilLDAPRoleAssignmentRule::getServerId ( )

get server id

public

Definition at line 255 of file class.ilLDAPRoleAssignmentRule.php.

References $server_id.

Referenced by create(), isGroupMember(), and update().

+ Here is the caller graph for this function:

◆ getType()

ilLDAPRoleAssignmentRule::getType ( )

getType

public

Parameters

Definition at line 279 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by conditionToString(), create(), isPluginActive(), matches(), update(), and validate().

280  {
281  return $this->type;
282  }
+ Here is the caller graph for this function:

◆ hasRulesForUpdate()

static ilLDAPRoleAssignmentRule::hasRulesForUpdate ( )
static

Check if there any rule for updates.

Returns

Definition at line 72 of file class.ilLDAPRoleAssignmentRule.php.

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilLDAPUserSynchronisation\isUpdateRequired(), ilAuthContainerApache\updateRequired(), and ilAuthContainerLDAP\updateRequired().

73  {
74  global $ilDB;
75 
76  $query = 'SELECT COUNT(*) num FROM ldap_role_assignments '.
77  'WHERE add_on_update = 1 '.
78  'OR remove_on_update = 1 ';
79  $res = $ilDB->query($query);
81  return $row->num > 0;
82  }
global $ilDB
+ Here is the caller graph for this function:

◆ isAddOnUpdateEnabled()

ilLDAPRoleAssignmentRule::isAddOnUpdateEnabled ( )

Definition at line 404 of file class.ilLDAPRoleAssignmentRule.php.

References $add_on_update.

Referenced by create(), and update().

405  {
406  return (bool) $this->add_on_update;
407  }
+ Here is the caller graph for this function:

◆ isGroupMember()

ilLDAPRoleAssignmentRule::isGroupMember (   $a_user_data)
private

Check if user is member of specific group.

private

Parameters
arrayuser data
arrayuser_data

Definition at line 146 of file class.ilLDAPRoleAssignmentRule.php.

References $query, $res, $server, array, getDN(), ilLDAPServer\getInstanceByServerId(), getMemberAttribute(), getServerId(), IL_LDAP_SCOPE_BASE, and isMemberAttributeDN().

Referenced by matches().

147  {
148  if($this->isMemberAttributeDN())
149  {
150  $user_cmp = $a_user_data['dn'];
151  }
152  else
153  {
154  $user_cmp = $a_user_data['ilExternalAccount'];
155  }
156 
157  include_once('Services/LDAP/classes/class.ilLDAPQuery.php');
158  include_once('Services/LDAP/classes/class.ilLDAPServer.php');
159 
161 
162  try
163  {
164  $query = new ilLDAPQuery($server);
165  $query->bind();
166  $res = $query->query($this->getDN(),
167  sprintf('(%s=%s)',
168  $this->getMemberAttribute(),
169  $user_cmp),
171  array('dn'));
172  return $res->numRows() ? true : false;
173  }
174  catch(ilLDAPQueryException $e)
175  {
176  $this->logger->warning(': Caught Exception: '.$e->getMessage());
177  return false;
178  }
179  }
isMemberAttributeDN()
is member attribute dn
static getInstanceByServerId($a_server_id)
Get instance by server id.
Create styles array
The data for the language used.
$server
const IL_LDAP_SCOPE_BASE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isMemberAttributeDN()

ilLDAPRoleAssignmentRule::isMemberAttributeDN ( )

is member attribute dn

public

Definition at line 348 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by create(), isGroupMember(), and update().

349  {
350  return (bool) $this->member_is_dn;
351  }
+ Here is the caller graph for this function:

◆ isPluginActive()

ilLDAPRoleAssignmentRule::isPluginActive ( )

Definition at line 429 of file class.ilLDAPRoleAssignmentRule.php.

References getType().

430  {
431  return (bool) $this->getType() == self::TYPE_PLUGIN;
432  }
+ Here is the call graph for this function:

◆ isRemoveOnUpdateEnabled()

ilLDAPRoleAssignmentRule::isRemoveOnUpdateEnabled ( )

Definition at line 414 of file class.ilLDAPRoleAssignmentRule.php.

References $remove_on_update.

Referenced by create(), and update().

415  {
416  return (bool) $this->remove_on_update;
417  }
+ Here is the caller graph for this function:

◆ matches()

ilLDAPRoleAssignmentRule::matches (   $a_user_data)

Check if a rule matches.

Returns
Parameters
object$a_user_data

Definition at line 89 of file class.ilLDAPRoleAssignmentRule.php.

References ilObject\_lookupTitle(), array, ilLDAPRoleAssignmentRules\callPlugin(), getAttributeName(), getAttributeValue(), getPluginId(), getRoleId(), getType(), isGroupMember(), and wildcardCompare().

90  {
91  switch($this->getType())
92  {
93  case self::TYPE_PLUGIN:
94  include_once './Services/LDAP/classes/class.ilLDAPRoleAssignmentRules.php';
95  return ilLDAPRoleAssignmentRules::callPlugin($this->getPluginId(), $a_user_data);
96 
97  case self::TYPE_ATTRIBUTE:
98 
99  $attn = strtolower($this->getAttributeName());
100 
101  if(!isset($a_user_data[$attn]))
102  {
103  return false;
104  }
105 
106  if(!is_array($a_user_data[$attn]))
107  {
108  $attribute_val = array(0 => $a_user_data[$attn]);
109  }
110  else
111  {
112  $attribute_val = $a_user_data[$attn];
113  }
114 
115  foreach($attribute_val as $value)
116  {
117  if($this->wildcardCompare(trim($this->getAttributeValue()),trim($value)))
118  {
119  $this->logger->debug(': Found role mapping: '.ilObject::_lookupTitle($this->getRoleId()));
120  return true;
121  }
122  }
123  return false;
124 
125  case self::TYPE_GROUP:
126  return $this->isGroupMember($a_user_data);
127 
128  }
129  }
static _lookupTitle($a_id)
lookup object title
isGroupMember($a_user_data)
Check if user is member of specific group.
static callPlugin($a_plugin_id, $a_user_data)
Call plugin check if the condition matches.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ read()

ilLDAPRoleAssignmentRule::read ( )
private

load from db

private

Definition at line 593 of file class.ilLDAPRoleAssignmentRule.php.

References $db, $ilDB, $query, $res, $row, enableAddOnUpdate(), enableRemoveOnUpdate(), ilDBConstants\FETCHMODE_OBJECT, getRuleId(), setAttributeName(), setAttributeValue(), setDN(), setMemberAttribute(), setMemberIsDN(), setPluginId(), setRoleId(), setServerId(), and setType().

Referenced by __construct().

594  {
595  $ilDB = $this->db;
596 
597  $query = "SELECT * FROM ldap_role_assignments ".
598  "WHERE rule_id = ".$this->db->quote($this->getRuleId(),'integer')." ";
599 
600  $res = $this->db->query($query);
601  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
602  {
603  $this->setServerId($row->server_id);
604  $this->setType($row->type);
605  $this->setDN($row->dn);
606  $this->setMemberAttribute($row->attribute);
607  $this->setMemberIsDN($row->isdn);
608  $this->setAttributeName($row->att_name);
609  $this->setAttributeValue($row->att_value);
610  $this->setRoleId($row->role_id);
611  $this->enableAddOnUpdate($row->add_on_update);
612  $this->enableRemoveOnUpdate($row->remove_on_update);
613  $this->setPluginId($row->plugin_id);
614  }
615  }
setAttributeName($a_name)
set attribute name
setAttributeValue($a_value)
set attribute value
global $ilDB
setMemberIsDN($a_status)
set member attribute is dn
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAttributeName()

ilLDAPRoleAssignmentRule::setAttributeName (   $a_name)

set attribute name

public

Parameters

Definition at line 360 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by read().

361  {
362  $this->attribute_name = $a_name;
363  }
+ Here is the caller graph for this function:

◆ setAttributeValue()

ilLDAPRoleAssignmentRule::setAttributeValue (   $a_value)

set attribute value

public

Parameters
stringvalue

Definition at line 383 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by read().

384  {
385  $this->attribute_value = $a_value;
386  }
+ Here is the caller graph for this function:

◆ setDN()

ilLDAPRoleAssignmentRule::setDN (   $a_dn)

set dn

public

Parameters
stringdn

Definition at line 291 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by read().

292  {
293  $this->dn = $a_dn;
294  }
+ Here is the caller graph for this function:

◆ setMemberAttribute()

ilLDAPRoleAssignmentRule::setMemberAttribute (   $a_attribute)

public

Parameters

Definition at line 314 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by read().

315  {
316  $this->member_attribute = $a_attribute;
317  }
+ Here is the caller graph for this function:

◆ setMemberIsDN()

ilLDAPRoleAssignmentRule::setMemberIsDN (   $a_status)

set member attribute is dn

public

Parameters
boolstatus

Definition at line 337 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by read().

338  {
339  $this->member_is_dn = $a_status;
340  }
+ Here is the caller graph for this function:

◆ setPluginId()

ilLDAPRoleAssignmentRule::setPluginId (   $a_id)

Definition at line 419 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by read().

420  {
421  $this->plugin_id = $a_id;
422  }
+ Here is the caller graph for this function:

◆ setRoleId()

ilLDAPRoleAssignmentRule::setRoleId (   $a_role_id)

set role id

public

Parameters
introle id of global role

Definition at line 210 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by read().

211  {
212  $this->role_id = $a_role_id;
213  }
+ Here is the caller graph for this function:

◆ setServerId()

ilLDAPRoleAssignmentRule::setServerId (   $a_id)

set server id

public

Parameters
intserver id

Definition at line 244 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by read().

245  {
246  $this->server_id = $a_id;
247  }
+ Here is the caller graph for this function:

◆ setType()

ilLDAPRoleAssignmentRule::setType (   $a_type)

set type

public

Parameters
inttype

Definition at line 267 of file class.ilLDAPRoleAssignmentRule.php.

References $a_type.

Referenced by read().

268  {
269  $this->type = $a_type;
270  }
$a_type
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ update()

ilLDAPRoleAssignmentRule::update ( )

update

public

Definition at line 501 of file class.ilLDAPRoleAssignmentRule.php.

References $db, $ilDB, $query, $res, getAttributeName(), getAttributeValue(), getDN(), getMemberAttribute(), getPluginId(), getRoleId(), getRuleId(), getServerId(), getType(), isAddOnUpdateEnabled(), isMemberAttributeDN(), and isRemoveOnUpdateEnabled().

502  {
503  $ilDB = $this->db;
504 
505  $query = "UPDATE ldap_role_assignments ".
506  "SET server_id = ".$this->db->quote($this->getServerId(),'integer').", ".
507  "type = ".$this->db->quote($this->getType(),'integer').", ".
508  "dn = ".$this->db->quote($this->getDN(),'text').", ".
509  "attribute = ".$this->db->quote($this->getMemberAttribute(),'text').", ".
510  "isdn = ".$this->db->quote($this->isMemberAttributeDN(),'integer').", ".
511  "att_name = ".$this->db->quote($this->getAttributeName(),'text').", ".
512  "att_value = ".$this->db->quote($this->getAttributeValue(),'text').", ".
513  "role_id = ".$this->db->quote($this->getRoleId(),'integer').", ".
514  "add_on_update = ".$this->db->quote($this->isAddOnUpdateEnabled(),'integer').', '.
515  'remove_on_update = '.$this->db->quote($this->isRemoveOnUpdateEnabled(),'integer').', '.
516  'plugin_id = '.$this->db->quote($this->getPluginId(),'integer').' '.
517  "WHERE rule_id = ".$this->db->quote($this->getRuleId(),'integer')." ";
518  $res = $ilDB->manipulate($query);
519  return true;
520  }
isMemberAttributeDN()
is member attribute dn
global $ilDB
+ Here is the call graph for this function:

◆ validate()

ilLDAPRoleAssignmentRule::validate ( )

validate

public

Definition at line 528 of file class.ilLDAPRoleAssignmentRule.php.

References $ilErr, getAttributeName(), getAttributeValue(), getDN(), getMemberAttribute(), getPluginId(), getRoleId(), and getType().

529  {
530  global $ilErr;
531 
532  $ilErr->setMessage('');
533 
534  if(!$this->getRoleId())
535  {
536  $ilErr->setMessage('fill_out_all_required_fields');
537  return false;
538  }
539  switch($this->getType())
540  {
541  case self::TYPE_GROUP:
542  if(!strlen($this->getDN()) or !strlen($this->getMemberAttribute()))
543  {
544  $ilErr->setMessage('fill_out_all_required_fields');
545  return false;
546  }
547  break;
548  case self::TYPE_ATTRIBUTE:
549  if(!strlen($this->getAttributeName()) or !strlen($this->getAttributeValue()))
550  {
551  $ilErr->setMessage('fill_out_all_required_fields');
552  return false;
553  }
554  break;
555 
556  case self::TYPE_PLUGIN:
557  if(!$this->getPluginId())
558  {
559  $ilErr->setMessage('ldap_err_missing_plugin_id');
560  return false;
561  }
562  break;
563 
564  default:
565  $ilErr->setMessage('ldap_no_type_given');
566  return false;
567  }
568  return true;
569  }
global $ilErr
Definition: raiseError.php:16
+ Here is the call graph for this function:

◆ wildcardCompare()

ilLDAPRoleAssignmentRule::wildcardCompare (   $a_str1,
  $a_str2 
)
protected

Definition at line 131 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by matches().

132  {
133  $pattern = str_replace('*','.*?', $a_str1);
134  $this->logger->debug(': Replace pattern:'. $pattern.' => '.$a_str2);
135  return (bool) preg_match('/^'.$pattern.'$/i',$a_str2);
136  }
+ Here is the caller graph for this function:

Field Documentation

◆ $add_on_update

ilLDAPRoleAssignmentRule::$add_on_update = false
private

Definition at line 30 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by isAddOnUpdateEnabled().

◆ $db

ilLDAPRoleAssignmentRule::$db = null
private

Definition at line 22 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by create(), delete(), read(), and update().

◆ $instances

ilLDAPRoleAssignmentRule::$instances = null
staticprivate

Definition at line 12 of file class.ilLDAPRoleAssignmentRule.php.

◆ $logger

ilLDAPRoleAssignmentRule::$logger = null
private

Definition at line 17 of file class.ilLDAPRoleAssignmentRule.php.

◆ $plugin_active

ilLDAPRoleAssignmentRule::$plugin_active = false
private

Definition at line 29 of file class.ilLDAPRoleAssignmentRule.php.

◆ $plugin_id

ilLDAPRoleAssignmentRule::$plugin_id = 0
private

Definition at line 32 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by getPluginId().

◆ $remove_on_update

ilLDAPRoleAssignmentRule::$remove_on_update = false
private

Definition at line 31 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by isRemoveOnUpdateEnabled().

◆ $server_id

ilLDAPRoleAssignmentRule::$server_id = 0
private

Definition at line 28 of file class.ilLDAPRoleAssignmentRule.php.

Referenced by getServerId().

◆ TYPE_ATTRIBUTE

const ilLDAPRoleAssignmentRule::TYPE_ATTRIBUTE = 2

◆ TYPE_GROUP

const ilLDAPRoleAssignmentRule::TYPE_GROUP = 1

◆ TYPE_PLUGIN

const ilLDAPRoleAssignmentRule::TYPE_PLUGIN = 3

The documentation for this class was generated from the following file: