ILIAS  release_7 Revision v7.30-3-g800a261c036
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 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64

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 return self::$instances[$a_rule_id];
63 }
64 return self::$instances[$a_rule_id] = new ilLDAPRoleAssignmentRule($a_rule_id);
65 }

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 182 of file class.ilLDAPRoleAssignmentRule.php.

183 {
184 $ilDB = $GLOBALS['DIC']->database();
185
186 $query = "SELECT rule_id FROM ldap_role_assignments " .
187 "WHERE server_id = " . $ilDB->quote($a_server_id, 'integer');
188 $res = $ilDB->query($query);
189 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
190 $rules[] = self::_getInstanceByRuleId($row->rule_id);
191 }
192 return $rules ? $rules : array();
193 }
static _getInstanceByRuleId($a_rule_id)
get instance by rule id
$query
foreach($_POST as $key=> $value) $res
global $ilDB

References $GLOBALS, $ilDB, $query, $res, _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 433 of file class.ilLDAPRoleAssignmentRule.php.

434 {
435 $lng = $GLOBALS['DIC']->language();
436
437 switch ($this->getType()) {
439 return $lng->txt('ldap_plugin_id') . ': ' . $this->getPluginId();
440
441 case self::TYPE_GROUP:
442 $dn_arr = explode(',', $this->getDN());
443 return $dn_arr[0];
444
445
447 return $this->getAttributeName() . '=' . $this->getAttributeValue();
448 }
449 }
$lng

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 459 of file class.ilLDAPRoleAssignmentRule.php.

460 {
462 $next_id = $ilDB->nextId('ldap_role_assignments');
463
464 $query = "INSERT INTO ldap_role_assignments (server_id,rule_id,type,dn,attribute,isdn,att_name,att_value,role_id, " .
465 "add_on_update, remove_on_update, plugin_id ) " .
466 "VALUES( " .
467 $this->db->quote($this->getServerId(), 'integer') . ", " .
468 $this->db->quote($next_id, 'integer') . ", " .
469 $this->db->quote($this->getType(), 'integer') . ", " .
470 $this->db->quote($this->getDN(), 'text') . ", " .
471 $this->db->quote($this->getMemberAttribute(), 'text') . ", " .
472 $this->db->quote($this->isMemberAttributeDN(), 'integer') . ", " .
473 $this->db->quote($this->getAttributeName(), 'text') . ", " .
474 $this->db->quote($this->getAttributeValue(), 'text') . ", " .
475 $this->db->quote($this->getRoleId(), 'integer') . ", " .
476 $this->db->quote($this->isAddOnUpdateEnabled(), 'integer') . ', ' .
477 $this->db->quote($this->isRemoveOnUpdateEnabled(), 'integer') . ', ' .
478 $this->db->quote($this->getPluginId(), 'integer') . ' ' .
479 ")";
480 $res = $ilDB->manipulate($query);
481 $this->rule_id = $next_id;
482
483 return true;
484 }
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 565 of file class.ilLDAPRoleAssignmentRule.php.

566 {
568
569 $query = "DELETE FROM ldap_role_assignments " .
570 "WHERE rule_id = " . $this->db->quote($this->getRuleId(), 'integer') . " ";
571 $res = $ilDB->manipulate($query);
572 return true;
573 }

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

+ Here is the call graph for this function:

◆ enableAddOnUpdate()

ilLDAPRoleAssignmentRule::enableAddOnUpdate (   $a_status)

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

392 {
393 $this->add_on_update = $a_status;
394 }

Referenced by read().

+ Here is the caller graph for this function:

◆ enableRemoveOnUpdate()

ilLDAPRoleAssignmentRule::enableRemoveOnUpdate (   $a_status)

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

402 {
403 $this->remove_on_update = $a_status;
404 }

Referenced by read().

+ Here is the caller graph for this function:

◆ getAttributeName()

ilLDAPRoleAssignmentRule::getAttributeName ( )

get attribute name

@access public

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

364 {
365 return $this->attribute_name;
366 }

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 386 of file class.ilLDAPRoleAssignmentRule.php.

387 {
388 return $this->attribute_value;
389 }

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 294 of file class.ilLDAPRoleAssignmentRule.php.

295 {
296 return $this->dn;
297 }

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 317 of file class.ilLDAPRoleAssignmentRule.php.

318 {
319 return $this->member_attribute;
320 }

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

+ Here is the caller graph for this function:

◆ getPluginId()

ilLDAPRoleAssignmentRule::getPluginId ( )

Definition at line 416 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 213 of file class.ilLDAPRoleAssignmentRule.php.

214 {
215 return $this->role_id;
216 }

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 224 of file class.ilLDAPRoleAssignmentRule.php.

225 {
226 return $this->rule_id;
227 }

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 247 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 271 of file class.ilLDAPRoleAssignmentRule.php.

272 {
273 return $this->type;
274 }
$type

References $type.

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 71 of file class.ilLDAPRoleAssignmentRule.php.

72 {
73 global $DIC;
74
75 $ilDB = $DIC['ilDB'];
76
77 $query = 'SELECT COUNT(*) num FROM ldap_role_assignments ' .
78 'WHERE add_on_update = 1 ' .
79 'OR remove_on_update = 1 ';
80 $res = $ilDB->query($query);
81 $row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT);
82 return $row->num > 0;
83 }
global $DIC
Definition: goto.php:24

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

Referenced by ilLDAPUserSynchronisation\isUpdateRequired().

+ Here is the caller graph for this function:

◆ isAddOnUpdateEnabled()

ilLDAPRoleAssignmentRule::isAddOnUpdateEnabled ( )

Definition at line 396 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 140 of file class.ilLDAPRoleAssignmentRule.php.

141 {
143
144 if ($this->isMemberAttributeDN()) {
145 if ($server->enabledEscapeDN()) {
146 $user_cmp = ldap_escape($a_user_data['dn'], "", LDAP_ESCAPE_FILTER);
147 } else {
148 $user_cmp = $a_user_data['dn'];
149 }
150 } else {
151 $user_cmp = $a_user_data['ilExternalAccount'];
152 }
153
154 try {
156 $query->bind();
157 $res = $query->query(
158 $this->getDN(),
159 sprintf(
160 '(%s=%s)',
161 $this->getMemberAttribute(),
162 $user_cmp
163 ),
165 array('dn')
166 );
167 return $res->numRows() ? true : false;
168 } catch (ilLDAPQueryException $e) {
169 $this->logger->warning(': Caught Exception: ' . $e->getMessage());
170 return false;
171 }
172 }
return true
Flag indicating whether or not HTTP headers will be sent when outputting captcha image/audio.
const IL_LDAP_SCOPE_BASE
static getInstanceByServerId($a_server_id)
Get instance by server id.
$server

References Vendor\Package\$e, $query, $res, $server, getDN(), ilLDAPServer\getInstanceByServerId(), getMemberAttribute(), getServerId(), IL_LDAP_SCOPE_BASE, isMemberAttributeDN(), and true.

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 340 of file class.ilLDAPRoleAssignmentRule.php.

341 {
342 return (bool) $this->member_is_dn;
343 }

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

+ Here is the caller graph for this function:

◆ isPluginActive()

ilLDAPRoleAssignmentRule::isPluginActive ( )

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

422 {
423 return (bool) $this->getType() == self::TYPE_PLUGIN;
424 }

References getType(), and TYPE_PLUGIN.

+ Here is the call graph for this function:

◆ isRemoveOnUpdateEnabled()

ilLDAPRoleAssignmentRule::isRemoveOnUpdateEnabled ( )

Definition at line 406 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 90 of file class.ilLDAPRoleAssignmentRule.php.

91 {
92 switch ($this->getType()) {
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 return false;
103 }
104
105 if (!is_array($a_user_data[$attn])) {
106 $attribute_val = array(0 => $a_user_data[$attn]);
107 } else {
108 $attribute_val = $a_user_data[$attn];
109 }
110
111 foreach ($attribute_val as $value) {
112 if ($this->wildcardCompare(trim($this->getAttributeValue()), trim($value))) {
113 $this->logger->debug(': Found role mapping: ' . ilObject::_lookupTitle($this->getRoleId()));
114 return true;
115 }
116 }
117 return false;
118
119 case self::TYPE_GROUP:
120 return $this->isGroupMember($a_user_data);
121
122 }
123 }
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 580 of file class.ilLDAPRoleAssignmentRule.php.

581 {
583
584 $query = "SELECT * FROM ldap_role_assignments " .
585 "WHERE rule_id = " . $this->db->quote($this->getRuleId(), 'integer') . " ";
586
587 $res = $this->db->query($query);
588 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
589 $this->setServerId($row->server_id);
590 $this->setType($row->type);
591 $this->setDN($row->dn);
592 $this->setMemberAttribute($row->attribute);
593 $this->setMemberIsDN($row->isdn);
594 $this->setAttributeName($row->att_name);
595 $this->setAttributeValue($row->att_value);
596 $this->setRoleId($row->role_id);
597 $this->enableAddOnUpdate($row->add_on_update);
598 $this->enableRemoveOnUpdate($row->remove_on_update);
599 $this->setPluginId($row->plugin_id);
600 }
601 }
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, 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 352 of file class.ilLDAPRoleAssignmentRule.php.

353 {
354 $this->attribute_name = $a_name;
355 }

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 375 of file class.ilLDAPRoleAssignmentRule.php.

376 {
377 $this->attribute_value = $a_value;
378 }

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 283 of file class.ilLDAPRoleAssignmentRule.php.

284 {
285 $this->dn = $a_dn;
286 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMemberAttribute()

ilLDAPRoleAssignmentRule::setMemberAttribute (   $a_attribute)

@access public

Parameters

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

307 {
308 $this->member_attribute = $a_attribute;
309 }

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 329 of file class.ilLDAPRoleAssignmentRule.php.

330 {
331 $this->member_is_dn = $a_status;
332 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setPluginId()

ilLDAPRoleAssignmentRule::setPluginId (   $a_id)

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

412 {
413 $this->plugin_id = $a_id;
414 }

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 202 of file class.ilLDAPRoleAssignmentRule.php.

203 {
204 $this->role_id = $a_role_id;
205 }

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 236 of file class.ilLDAPRoleAssignmentRule.php.

237 {
238 $this->server_id = $a_id;
239 }

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 259 of file class.ilLDAPRoleAssignmentRule.php.

260 {
261 $this->type = $a_type;
262 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilLDAPRoleAssignmentRule::update ( )

update

@access public

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

493 {
495
496 $query = "UPDATE ldap_role_assignments " .
497 "SET server_id = " . $this->db->quote($this->getServerId(), 'integer') . ", " .
498 "type = " . $this->db->quote($this->getType(), 'integer') . ", " .
499 "dn = " . $this->db->quote($this->getDN(), 'text') . ", " .
500 "attribute = " . $this->db->quote($this->getMemberAttribute(), 'text') . ", " .
501 "isdn = " . $this->db->quote($this->isMemberAttributeDN(), 'integer') . ", " .
502 "att_name = " . $this->db->quote($this->getAttributeName(), 'text') . ", " .
503 "att_value = " . $this->db->quote($this->getAttributeValue(), 'text') . ", " .
504 "role_id = " . $this->db->quote($this->getRoleId(), 'integer') . ", " .
505 "add_on_update = " . $this->db->quote($this->isAddOnUpdateEnabled(), 'integer') . ', ' .
506 'remove_on_update = ' . $this->db->quote($this->isRemoveOnUpdateEnabled(), 'integer') . ', ' .
507 'plugin_id = ' . $this->db->quote($this->getPluginId(), 'integer') . ' ' .
508 "WHERE rule_id = " . $this->db->quote($this->getRuleId(), 'integer') . " ";
509 $res = $ilDB->manipulate($query);
510 return true;
511 }

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 519 of file class.ilLDAPRoleAssignmentRule.php.

520 {
521 global $DIC;
522
523 $ilErr = $DIC['ilErr'];
524
525 $ilErr->setMessage('');
526
527 if (!$this->getRoleId()) {
528 $ilErr->setMessage('fill_out_all_required_fields');
529 return false;
530 }
531 switch ($this->getType()) {
532 case self::TYPE_GROUP:
533 if (!strlen($this->getDN()) or !strlen($this->getMemberAttribute())) {
534 $ilErr->setMessage('fill_out_all_required_fields');
535 return false;
536 }
537 break;
539 if (!strlen($this->getAttributeName()) or !strlen($this->getAttributeValue())) {
540 $ilErr->setMessage('fill_out_all_required_fields');
541 return false;
542 }
543 break;
544
546 if (!$this->getPluginId()) {
547 $ilErr->setMessage('ldap_err_missing_plugin_id');
548 return false;
549 }
550 break;
551
552 default:
553 $ilErr->setMessage('ldap_no_type_given');
554 return false;
555 }
556 return true;
557 }
$ilErr
Definition: raiseError.php:18

References $DIC, $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 125 of file class.ilLDAPRoleAssignmentRule.php.

126 {
127 $pattern = str_replace('*', '.*?', $a_str1);
128 $this->logger->debug(': Replace pattern:' . $pattern . ' => ' . $a_str2);
129 return (bool) preg_match('/^' . $pattern . '$/i', $a_str2);
130 }

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: