ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilLDAPRoleAssignmentRule Class Reference
+ Collaboration diagram for ilLDAPRoleAssignmentRule:

Public Member Functions

 matches ($a_user_data)
 Check if a rule matches. More...
 
 _getRules ()
 Get all rules. 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...
 

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

 $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

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilLDAPRoleAssignmentRule::__construct (   $a_id = 0)
private

Constructor.

@access private

Parameters
intrule id

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

55 {
56 global $ilDB;
57
58 $this->db = $ilDB;
59
60 $this->rule_id = $a_id;
61 $this->read();
62 }
global $ilDB

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

73 {
74 if(isset(self::$instances[$a_rule_id]))
75 {
76 return self::$instances[$a_rule_id];
77 }
78 return self::$instances[$a_rule_id] = new ilLDAPRoleAssignmentRule($a_rule_id);
79 }

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

ilLDAPRoleAssignmentRule::_getRules ( )

Get all rules.

@access public

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

215 {
216 global $ilDB;
217
218 $query = "SELECT rule_id FROM ldap_role_assignments ";
219 $res = $ilDB->query($query);
220 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
221 {
222 $rules[] = self::_getInstanceByRuleId($row->rule_id);
223 }
224 return $rules ? $rules : array();
225 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
static _getInstanceByRuleId($a_rule_id)
get instance by rule id

References $ilDB, $query, $res, $row, _getInstanceByRuleId(), and DB_FETCHMODE_OBJECT.

Referenced by 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 465 of file class.ilLDAPRoleAssignmentRule.php.

466 {
467 global $lng;
468
469 switch($this->getType())
470 {
472 return $lng->txt('ldap_plugin_id').': '.$this->getPluginId();
473
474 case self::TYPE_GROUP:
475 $dn_arr = explode(',',$this->getDN());
476 return $dn_arr[0];
477
478
480 return $this->getAttributeName().'='.$this->getAttributeValue();
481 }
482 }
global $lng
Definition: privfeed.php:40

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

493 {
494 global $ilDB;
495
496 $next_id = $ilDB->nextId('ldap_role_assignments');
497
498 $query = "INSERT INTO ldap_role_assignments (server_id,rule_id,type,dn,attribute,isdn,att_name,att_value,role_id, ".
499 "add_on_update, remove_on_update, plugin_id ) ".
500 "VALUES( ".
501 $this->db->quote($this->getServerId(),'integer').", ".
502 $this->db->quote($next_id,'integer').", ".
503 $this->db->quote($this->getType(),'integer').", ".
504 $this->db->quote($this->getDN(),'text').", ".
505 $this->db->quote($this->getMemberAttribute(),'text').", ".
506 $this->db->quote($this->isMemberAttributeDN(),'integer').", ".
507 $this->db->quote($this->getAttributeName(),'text').", ".
508 $this->db->quote($this->getAttributeValue(),'text').", ".
509 $this->db->quote($this->getRoleId(),'integer').", ".
510 $this->db->quote($this->isAddOnUpdateEnabled(), 'integer').', '.
511 $this->db->quote($this->isRemoveOnUpdateEnabled(), 'integer').', '.
512 $this->db->quote($this->getPluginId(),'integer').' '.
513 ")";
514 $res = $ilDB->manipulate($query);
515 $this->rule_id = $next_id;
516
517 return true;
518 }
isMemberAttributeDN()
is member attribute dn

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

603 {
604 global $ilDB;
605
606 $query = "DELETE FROM ldap_role_assignments ".
607 "WHERE rule_id = ".$this->db->quote($this->getRuleId(),'integer')." ";
608 $res = $ilDB->manipulate($query);
609 return true;
610
611 }

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

+ Here is the call graph for this function:

◆ enableAddOnUpdate()

ilLDAPRoleAssignmentRule::enableAddOnUpdate (   $a_status)

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

424 {
425 $this->add_on_update = $a_status;
426 }

Referenced by read().

+ Here is the caller graph for this function:

◆ enableRemoveOnUpdate()

ilLDAPRoleAssignmentRule::enableRemoveOnUpdate (   $a_status)

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

434 {
435 $this->remove_on_update = $a_status;
436 }

Referenced by read().

+ Here is the caller graph for this function:

◆ getAttributeName()

ilLDAPRoleAssignmentRule::getAttributeName ( )

get attribute name

@access public

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

396 {
397 return $this->attribute_name;
398 }

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

419 {
420 return $this->attribute_value;
421 }

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

327 {
328 return $this->dn;
329 }

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

350 {
351 return $this->member_attribute;
352 }

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

+ Here is the caller graph for this function:

◆ getPluginId()

ilLDAPRoleAssignmentRule::getPluginId ( )

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

246 {
247 return $this->role_id;
248 }

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

+ Here is the caller graph for this function:

◆ getRuleId()

ilLDAPRoleAssignmentRule::getRuleId ( )

get id

@access public

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

257 {
258 return $this->rule_id;
259 }

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

References $server_id.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getType()

ilLDAPRoleAssignmentRule::getType ( )

getType

@access public

Parameters

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

304 {
305 return $this->type;
306 }

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

86 {
87 global $ilDB;
88
89 $query = 'SELECT COUNT(*) num FROM ldap_role_assignments '.
90 'WHERE add_on_update = 1 '.
91 'OR remove_on_update = 1 ';
92 $res = $ilDB->query($query);
93 $row = $res->fetchRow(DB_FETCHMODE_OBJECT);
94 return $row->num > 0;
95 }

References $ilDB, $query, $res, $row, and DB_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 428 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 168 of file class.ilLDAPRoleAssignmentRule.php.

169 {
170 global $ilLog;
171
172
173 if($this->isMemberAttributeDN())
174 {
175 $user_cmp = $a_user_data['dn'];
176 }
177 else
178 {
179 $user_cmp = $a_user_data['ilExternalAccount'];
180 }
181
182 include_once('Services/LDAP/classes/class.ilLDAPQuery.php');
183 include_once('Services/LDAP/classes/class.ilLDAPServer.php');
184
186
187 try
188 {
190 $query->bind();
191 $res = $query->query($this->getDN(),
192 sprintf('(%s=%s)',
193 $this->getMemberAttribute(),
194 $user_cmp),
196 array('dn'));
197 return $res->numRows() ? true : false;
198 }
199 catch(ilLDAPQueryException $e)
200 {
201 $ilLog->write(__METHOD__.': Caught Exception: '.$e->getMessage());
202 return false;
203 }
204 }
const IL_LDAP_SCOPE_BASE
static getInstanceByServerId($a_server_id)
static _getFirstActiveServer()
Get first active server.
$server

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

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

373 {
374 return (bool) $this->member_is_dn;
375 }

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

+ Here is the caller graph for this function:

◆ isPluginActive()

ilLDAPRoleAssignmentRule::isPluginActive ( )

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

454 {
455 return (bool) $this->getType() == self::TYPE_PLUGIN;
456 }

References getType(), and TYPE_PLUGIN.

+ Here is the call graph for this function:

◆ isRemoveOnUpdateEnabled()

ilLDAPRoleAssignmentRule::isRemoveOnUpdateEnabled ( )

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

103 {
104 global $ilLog;
105
106 switch($this->getType())
107 {
109 include_once './Services/LDAP/classes/class.ilLDAPRoleAssignmentRules.php';
110 return ilLDAPRoleAssignmentRules::callPlugin($this->getPluginId(), $a_user_data);
111
113
114 $attn = strtolower($this->getAttributeName());
115
116 if(!isset($a_user_data[$attn]))
117 {
118 return false;
119 }
120
121 if(!is_array($a_user_data[$attn]))
122 {
123 $attribute_val = array(0 => $a_user_data[$attn]);
124 }
125 else
126 {
127 $attribute_val = $a_user_data[$attn];
128 }
129
130 foreach($attribute_val as $value)
131 {
132 if($this->wildcardCompare(trim($this->getAttributeValue()),trim($value)))
133 {
134 $ilLog->write(__METHOD__.': Found role mapping: '.ilObject::_lookupTitle($this->getRoleId()));
135 return true;
136 }
137 /*
138 if(trim($value) == trim($this->getAttributeValue()))
139 {
140 $ilLog->write(__METHOD__.': Found role mapping: '.ilObject::_lookupTitle($this->getRoleId()));
141 return true;
142 }
143 */
144 }
145 return false;
146
147 case self::TYPE_GROUP:
148 return $this->isGroupMember($a_user_data);
149
150 }
151 }
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 $ilLog, ilObject\_lookupTitle(), ilLDAPRoleAssignmentRules\callPlugin(), getAttributeName(), getAttributeValue(), getPluginId(), 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 618 of file class.ilLDAPRoleAssignmentRule.php.

619 {
620 global $ilDB;
621
622 $query = "SELECT * FROM ldap_role_assignments ".
623 "WHERE rule_id = ".$this->db->quote($this->getRuleId(),'integer')." ";
624
625 $res = $this->db->query($query);
626 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
627 {
628 $this->setServerId($row->server_id);
629 $this->setType($row->type);
630 $this->setDN($row->dn);
631 $this->setMemberAttribute($row->attribute);
632 $this->setMemberIsDN($row->isdn);
633 $this->setAttributeName($row->att_name);
634 $this->setAttributeValue($row->att_value);
635 $this->setRoleId($row->role_id);
636 $this->enableAddOnUpdate($row->add_on_update);
637 $this->enableRemoveOnUpdate($row->remove_on_update);
638 $this->setPluginId($row->plugin_id);
639 }
640 }
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 $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, enableAddOnUpdate(), enableRemoveOnUpdate(), 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 384 of file class.ilLDAPRoleAssignmentRule.php.

385 {
386 $this->attribute_name = $a_name;
387 }

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

408 {
409 $this->attribute_value = $a_value;
410 }

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

316 {
317 $this->dn = $a_dn;
318 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMemberAttribute()

ilLDAPRoleAssignmentRule::setMemberAttribute (   $a_attribute)

@access public

Parameters

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

339 {
340 $this->member_attribute = $a_attribute;
341 }

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

362 {
363 $this->member_is_dn = $a_status;
364 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setPluginId()

ilLDAPRoleAssignmentRule::setPluginId (   $a_id)

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

444 {
445 $this->plugin_id = $a_id;
446 }

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

235 {
236 $this->role_id = $a_role_id;
237 }

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

269 {
270 $this->server_id = $a_id;
271 }

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

292 {
293 $this->type = $a_type;
294 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilLDAPRoleAssignmentRule::update ( )

update

@access public

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

527 {
528 global $ilDB;
529
530 $query = "UPDATE ldap_role_assignments ".
531 "SET server_id = ".$this->db->quote($this->getServerId(),'integer').", ".
532 "type = ".$this->db->quote($this->getType(),'integer').", ".
533 "dn = ".$this->db->quote($this->getDN(),'text').", ".
534 "attribute = ".$this->db->quote($this->getMemberAttribute(),'text').", ".
535 "isdn = ".$this->db->quote($this->isMemberAttributeDN(),'integer').", ".
536 "att_name = ".$this->db->quote($this->getAttributeName(),'text').", ".
537 "att_value = ".$this->db->quote($this->getAttributeValue(),'text').", ".
538 "role_id = ".$this->db->quote($this->getRoleId(),'integer').", ".
539 "add_on_update = ".$this->db->quote($this->isAddOnUpdateEnabled(),'integer').', '.
540 'remove_on_update = '.$this->db->quote($this->isRemoveOnUpdateEnabled(),'integer').', '.
541 'plugin_id = '.$this->db->quote($this->getPluginId(),'integer').' '.
542 "WHERE rule_id = ".$this->db->quote($this->getRuleId(),'integer')." ";
543 $res = $ilDB->manipulate($query);
544 return true;
545 }

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

554 {
555 global $ilErr;
556
557 $ilErr->setMessage('');
558
559 if(!$this->getRoleId())
560 {
561 $ilErr->setMessage('fill_out_all_required_fields');
562 return false;
563 }
564 switch($this->getType())
565 {
566 case self::TYPE_GROUP:
567 if(!strlen($this->getDN()) or !strlen($this->getMemberAttribute()))
568 {
569 $ilErr->setMessage('fill_out_all_required_fields');
570 return false;
571 }
572 break;
574 if(!strlen($this->getAttributeName()) or !strlen($this->getAttributeValue()))
575 {
576 $ilErr->setMessage('fill_out_all_required_fields');
577 return false;
578 }
579 break;
580
582 if(!$this->getPluginId())
583 {
584 $ilErr->setMessage('ldap_err_missing_plugin_id');
585 return false;
586 }
587 break;
588
589 default:
590 $ilErr->setMessage('ldap_no_type_given');
591 return false;
592 }
593 return true;
594 }

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

154 {
155 $pattern = str_replace('*','.*?', $a_str1);
156 $GLOBALS['ilLog']->write(__METHOD__.': Replace pattern:'. $pattern.' => '.$a_str2);
157 return (bool) preg_match('/^'.$pattern.'$/i',$a_str2);
158 }
$GLOBALS['ct_recipient']

References $GLOBALS.

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

Referenced by isAddOnUpdateEnabled().

◆ $instances

ilLDAPRoleAssignmentRule::$instances = null
staticprivate

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

◆ $plugin_active

ilLDAPRoleAssignmentRule::$plugin_active = false
private

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

◆ $plugin_id

ilLDAPRoleAssignmentRule::$plugin_id = 0
private

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

Referenced by getPluginId().

◆ $remove_on_update

ilLDAPRoleAssignmentRule::$remove_on_update = false
private

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

Referenced by isRemoveOnUpdateEnabled().

◆ $server_id

ilLDAPRoleAssignmentRule::$server_id = 0
private

Definition at line 40 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: