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)
 @access 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.

@access private

Parameters
intrule id

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

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.

References $GLOBALS, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstanceByRuleId()

static ilLDAPRoleAssignmentRule::_getInstanceByRuleId (   $a_rule_id)
static

get instance by rule id

@access public

Parameters
intrule id

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

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 }

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

+ Here is the caller graph for this function:

◆ _getRules()

static ilLDAPRoleAssignmentRule::_getRules (   $a_server_id)
static

Get all rules.

@access public

Returns
ilLDAPRoleAssignmentRule

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

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 }
static _getInstanceByRuleId($a_rule_id)
get instance by rule id
global $ilDB

References $GLOBALS, $ilDB, $query, $res, $row, _getInstanceByRuleId(), and ilDBConstants\FETCHMODE_OBJECT.

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ conditionToString()

ilLDAPRoleAssignmentRule::conditionToString ( )

condition to string

@access public

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

442 {
443 $lng = $GLOBALS['DIC']->language();
444
445 switch($this->getType())
446 {
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
456 return $this->getAttributeName().'='.$this->getAttributeValue();
457 }
458 }
global $lng
Definition: privfeed.php:17

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

+ Here is the call graph for this function:

◆ create()

ilLDAPRoleAssignmentRule::create ( )

create

@access public

Parameters

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

469 {
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

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

+ Here is the call graph for this function:

◆ delete()

ilLDAPRoleAssignmentRule::delete ( )

delete rule

@access public

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

578 {
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 }

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

+ Here is the call graph for this function:

◆ enableAddOnUpdate()

ilLDAPRoleAssignmentRule::enableAddOnUpdate (   $a_status)

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

400 {
401 $this->add_on_update = $a_status;
402 }

Referenced by read().

+ Here is the caller graph for this function:

◆ enableRemoveOnUpdate()

ilLDAPRoleAssignmentRule::enableRemoveOnUpdate (   $a_status)

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

410 {
411 $this->remove_on_update = $a_status;
412 }

Referenced by read().

+ Here is the caller graph for this function:

◆ getAttributeName()

ilLDAPRoleAssignmentRule::getAttributeName ( )

get attribute name

@access public

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

372 {
373 return $this->attribute_name;
374 }

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

+ Here is the caller graph for this function:

◆ getAttributeValue()

ilLDAPRoleAssignmentRule::getAttributeValue ( )

get atrtibute value

@access public

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

395 {
396 return $this->attribute_value;
397 }

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

+ Here is the caller graph for this function:

◆ getDN()

ilLDAPRoleAssignmentRule::getDN ( )

get dn

@access public

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

303 {
304 return $this->dn;
305 }

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

+ Here is the caller graph for this function:

◆ getMemberAttribute()

ilLDAPRoleAssignmentRule::getMemberAttribute ( )

get attribute

@access public

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

326 {
327 return $this->member_attribute;
328 }

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

+ 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

@access public

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

222 {
223 return $this->role_id;
224 }

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

+ Here is the caller graph for this function:

◆ getRuleId()

ilLDAPRoleAssignmentRule::getRuleId ( )

get id

@access public

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

233 {
234 return $this->rule_id;
235 }

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

+ Here is the caller graph for this function:

◆ getServerId()

ilLDAPRoleAssignmentRule::getServerId ( )

get server id

@access 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

@access public

Parameters

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

280 {
281 return $this->type;
282 }

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

+ 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.

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 }

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

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

+ 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().

+ Here is the caller graph for this function:

◆ isGroupMember()

ilLDAPRoleAssignmentRule::isGroupMember (   $a_user_data)
private

Check if user is member of specific group.

@access private

Parameters
arrayuser data
arrayuser_data

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

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 {
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 }
sprintf('%.4f', $callTime)
const IL_LDAP_SCOPE_BASE
static getInstanceByServerId($a_server_id)
Get instance by server id.
$server

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

Referenced by matches().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isMemberAttributeDN()

ilLDAPRoleAssignmentRule::isMemberAttributeDN ( )

is member attribute dn

@access public

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

349 {
350 return (bool) $this->member_is_dn;
351 }

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

+ Here is the caller graph for this function:

◆ isPluginActive()

ilLDAPRoleAssignmentRule::isPluginActive ( )

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

430 {
431 return (bool) $this->getType() == self::TYPE_PLUGIN;
432 }

References getType(), and TYPE_PLUGIN.

+ 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().

+ 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.

90 {
91 switch($this->getType())
92 {
94 include_once './Services/LDAP/classes/class.ilLDAPRoleAssignmentRules.php';
95 return ilLDAPRoleAssignmentRules::callPlugin($this->getPluginId(), $a_user_data);
96
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 }
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.
static _lookupTitle($a_id)
lookup object title

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

+ Here is the call graph for this function:

◆ read()

ilLDAPRoleAssignmentRule::read ( )
private

load from db

@access private

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

594 {
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 }
setMemberAttribute($a_attribute)
@access public
setAttributeName($a_name)
set attribute name
setAttributeValue($a_value)
set attribute value
setMemberIsDN($a_status)
set member attribute is dn

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAttributeName()

ilLDAPRoleAssignmentRule::setAttributeName (   $a_name)

set attribute name

@access public

Parameters

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

361 {
362 $this->attribute_name = $a_name;
363 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setAttributeValue()

ilLDAPRoleAssignmentRule::setAttributeValue (   $a_value)

set attribute value

@access public

Parameters
stringvalue

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

384 {
385 $this->attribute_value = $a_value;
386 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setDN()

ilLDAPRoleAssignmentRule::setDN (   $a_dn)

set dn

@access public

Parameters
stringdn

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

292 {
293 $this->dn = $a_dn;
294 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMemberAttribute()

ilLDAPRoleAssignmentRule::setMemberAttribute (   $a_attribute)

@access public

Parameters

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

315 {
316 $this->member_attribute = $a_attribute;
317 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMemberIsDN()

ilLDAPRoleAssignmentRule::setMemberIsDN (   $a_status)

set member attribute is dn

@access public

Parameters
boolstatus

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

338 {
339 $this->member_is_dn = $a_status;
340 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setPluginId()

ilLDAPRoleAssignmentRule::setPluginId (   $a_id)

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

420 {
421 $this->plugin_id = $a_id;
422 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setRoleId()

ilLDAPRoleAssignmentRule::setRoleId (   $a_role_id)

set role id

@access public

Parameters
introle id of global role

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

211 {
212 $this->role_id = $a_role_id;
213 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setServerId()

ilLDAPRoleAssignmentRule::setServerId (   $a_id)

set server id

@access public

Parameters
intserver id

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

245 {
246 $this->server_id = $a_id;
247 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setType()

ilLDAPRoleAssignmentRule::setType (   $a_type)

set type

@access public

Parameters
inttype

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

268 {
269 $this->type = $a_type;
270 }
$a_type
Definition: workflow.php:93

References $a_type.

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilLDAPRoleAssignmentRule::update ( )

update

@access public

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

502 {
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 }

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

+ Here is the call graph for this function:

◆ validate()

ilLDAPRoleAssignmentRule::validate ( )

validate

@access public

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

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;
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
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

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

+ 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.

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 }

Referenced by matches().

+ 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: