ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 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 179 of file class.ilLDAPRoleAssignmentRule.php.

180 {
181 $ilDB = $GLOBALS['DIC']->database();
182
183 $query = "SELECT rule_id FROM ldap_role_assignments " .
184 "WHERE server_id = " . $ilDB->quote($a_server_id, 'integer');
185 $res = $ilDB->query($query);
186 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
187 $rules[] = self::_getInstanceByRuleId($row->rule_id);
188 }
189 return $rules ? $rules : array();
190 }
static _getInstanceByRuleId($a_rule_id)
get instance by rule id
$query
foreach($_POST as $key=> $value) $res
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 430 of file class.ilLDAPRoleAssignmentRule.php.

431 {
432 $lng = $GLOBALS['DIC']->language();
433
434 switch ($this->getType()) {
436 return $lng->txt('ldap_plugin_id') . ': ' . $this->getPluginId();
437
438 case self::TYPE_GROUP:
439 $dn_arr = explode(',', $this->getDN());
440 return $dn_arr[0];
441
442
444 return $this->getAttributeName() . '=' . $this->getAttributeValue();
445 }
446 }
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 456 of file class.ilLDAPRoleAssignmentRule.php.

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

561 {
563
564 $query = "DELETE FROM ldap_role_assignments " .
565 "WHERE rule_id = " . $this->db->quote($this->getRuleId(), 'integer') . " ";
566 $res = $ilDB->manipulate($query);
567 return true;
568 }

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

+ Here is the call graph for this function:

◆ enableAddOnUpdate()

ilLDAPRoleAssignmentRule::enableAddOnUpdate (   $a_status)

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

389 {
390 $this->add_on_update = $a_status;
391 }

Referenced by read().

+ Here is the caller graph for this function:

◆ enableRemoveOnUpdate()

ilLDAPRoleAssignmentRule::enableRemoveOnUpdate (   $a_status)

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

399 {
400 $this->remove_on_update = $a_status;
401 }

Referenced by read().

+ Here is the caller graph for this function:

◆ getAttributeName()

ilLDAPRoleAssignmentRule::getAttributeName ( )

get attribute name

@access public

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

361 {
362 return $this->attribute_name;
363 }

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

384 {
385 return $this->attribute_value;
386 }

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

292 {
293 return $this->dn;
294 }

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

315 {
316 return $this->member_attribute;
317 }

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

+ Here is the caller graph for this function:

◆ getPluginId()

ilLDAPRoleAssignmentRule::getPluginId ( )

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

211 {
212 return $this->role_id;
213 }

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

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

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

269 {
270 return $this->type;
271 }
$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 $ilDB;
74
75 $query = 'SELECT COUNT(*) num FROM ldap_role_assignments ' .
76 'WHERE add_on_update = 1 ' .
77 'OR remove_on_update = 1 ';
78 $res = $ilDB->query($query);
80 return $row->num > 0;
81 }

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

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

+ Here is the caller graph for this function:

◆ isAddOnUpdateEnabled()

ilLDAPRoleAssignmentRule::isAddOnUpdateEnabled ( )

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

139 {
140 if ($this->isMemberAttributeDN()) {
141 $user_cmp = $a_user_data['dn'];
142 } else {
143 $user_cmp = $a_user_data['ilExternalAccount'];
144 }
145
146 include_once('Services/LDAP/classes/class.ilLDAPQuery.php');
147 include_once('Services/LDAP/classes/class.ilLDAPServer.php');
148
150
151 try {
153 $query->bind();
154 $res = $query->query(
155 $this->getDN(),
156 sprintf(
157 '(%s=%s)',
158 $this->getMemberAttribute(),
159 $user_cmp
160 ),
162 array('dn')
163 );
164 return $res->numRows() ? true : false;
165 } catch (ilLDAPQueryException $e) {
166 $this->logger->warning(': Caught Exception: ' . $e->getMessage());
167 return false;
168 }
169 }
sprintf('%.4f', $callTime)
const IL_LDAP_SCOPE_BASE
static getInstanceByServerId($a_server_id)
Get instance by server id.
$server
Definition: getUserInfo.php:12

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

338 {
339 return (bool) $this->member_is_dn;
340 }

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

+ Here is the caller graph for this function:

◆ isPluginActive()

ilLDAPRoleAssignmentRule::isPluginActive ( )

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

419 {
420 return (bool) $this->getType() == self::TYPE_PLUGIN;
421 }

References getType(), and TYPE_PLUGIN.

+ Here is the call graph for this function:

◆ isRemoveOnUpdateEnabled()

ilLDAPRoleAssignmentRule::isRemoveOnUpdateEnabled ( )

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

89 {
90 switch ($this->getType()) {
92 include_once './Services/LDAP/classes/class.ilLDAPRoleAssignmentRules.php';
93 return ilLDAPRoleAssignmentRules::callPlugin($this->getPluginId(), $a_user_data);
94
96
97 $attn = strtolower($this->getAttributeName());
98
99 if (!isset($a_user_data[$attn])) {
100 return false;
101 }
102
103 if (!is_array($a_user_data[$attn])) {
104 $attribute_val = array(0 => $a_user_data[$attn]);
105 } else {
106 $attribute_val = $a_user_data[$attn];
107 }
108
109 foreach ($attribute_val as $value) {
110 if ($this->wildcardCompare(trim($this->getAttributeValue()), trim($value))) {
111 $this->logger->debug(': Found role mapping: ' . ilObject::_lookupTitle($this->getRoleId()));
112 return true;
113 }
114 }
115 return false;
116
117 case self::TYPE_GROUP:
118 return $this->isGroupMember($a_user_data);
119
120 }
121 }
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 575 of file class.ilLDAPRoleAssignmentRule.php.

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

350 {
351 $this->attribute_name = $a_name;
352 }

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

373 {
374 $this->attribute_value = $a_value;
375 }

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

281 {
282 $this->dn = $a_dn;
283 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMemberAttribute()

ilLDAPRoleAssignmentRule::setMemberAttribute (   $a_attribute)

@access public

Parameters

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

304 {
305 $this->member_attribute = $a_attribute;
306 }

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

327 {
328 $this->member_is_dn = $a_status;
329 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setPluginId()

ilLDAPRoleAssignmentRule::setPluginId (   $a_id)

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

409 {
410 $this->plugin_id = $a_id;
411 }

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

200 {
201 $this->role_id = $a_role_id;
202 }

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

234 {
235 $this->server_id = $a_id;
236 }

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

257 {
258 $this->type = $a_type;
259 }
$a_type
Definition: workflow.php:92

References $a_type.

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilLDAPRoleAssignmentRule::update ( )

update

@access public

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

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

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

517 {
518 global $ilErr;
519
520 $ilErr->setMessage('');
521
522 if (!$this->getRoleId()) {
523 $ilErr->setMessage('fill_out_all_required_fields');
524 return false;
525 }
526 switch ($this->getType()) {
527 case self::TYPE_GROUP:
528 if (!strlen($this->getDN()) or !strlen($this->getMemberAttribute())) {
529 $ilErr->setMessage('fill_out_all_required_fields');
530 return false;
531 }
532 break;
534 if (!strlen($this->getAttributeName()) or !strlen($this->getAttributeValue())) {
535 $ilErr->setMessage('fill_out_all_required_fields');
536 return false;
537 }
538 break;
539
541 if (!$this->getPluginId()) {
542 $ilErr->setMessage('ldap_err_missing_plugin_id');
543 return false;
544 }
545 break;
546
547 default:
548 $ilErr->setMessage('ldap_no_type_given');
549 return false;
550 }
551 return true;
552 }
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 123 of file class.ilLDAPRoleAssignmentRule.php.

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

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: