Collaboration diagram for ilLDAPRoleAssignmentRule:Public Member Functions | |
| _getRules () | |
| Get all rules. | |
| setRoleId ($a_role_id) | |
| set role id | |
| getRoleId () | |
| get role id | |
| getRuleId () | |
| get id | |
| setServerId ($a_id) | |
| set server id | |
| getServerId () | |
| get server id | |
| setType ($a_type) | |
| set type | |
| getType () | |
| getType | |
| setDN ($a_dn) | |
| set dn | |
| getDN () | |
| get dn | |
| setMemberAttribute ($a_attribute) | |
| public | |
| getMemberAttribute () | |
| get attribute | |
| setMemberIsDN ($a_status) | |
| set member attribute is dn | |
| isMemberAttributeDN () | |
| is member attribute dn | |
| setAttributeName ($a_name) | |
| set attribute name | |
| getAttributeName () | |
| get attribute name | |
| setAttributeValue ($a_value) | |
| set attribute value | |
| getAttributeValue () | |
| get atrtibute value | |
| conditionToString () | |
| condition to string | |
| create () | |
| create | |
| update () | |
| update | |
| validate () | |
| validate | |
| delete () | |
| delete rule | |
Static Public Member Functions | |
| static | _getInstanceByRuleId ($a_rule_id) |
| get instance by rule id | |
Data Fields | |
| const | TYPE_GROUP = 1 |
| const | TYPE_ATTRIBUTE = 2 |
Private Member Functions | |
| __construct ($a_id=0) | |
| Constructor. | |
| read () | |
| load from db | |
Static Private Attributes | |
| static | $instances = null |
Definition at line 32 of file class.ilLDAPRoleAssignmentRule.php.
| ilLDAPRoleAssignmentRule::__construct | ( | $ | a_id = 0 |
) | [private] |
Constructor.
private
| int | rule id |
Definition at line 46 of file class.ilLDAPRoleAssignmentRule.php.
References read().
{
global $ilDB;
$this->db = $ilDB;
$this->rule_id = $a_id;
$this->read();
}
Here is the call graph for this function:| static ilLDAPRoleAssignmentRule::_getInstanceByRuleId | ( | $ | a_rule_id | ) | [static] |
get instance by rule id
public
| int | rule id |
Definition at line 64 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by _getRules(), ilLDAPSettingsGUI::addRoleAssignment(), ilLDAPSettingsGUI::confirmDeleteRules(), ilLDAPSettingsGUI::deleteRules(), ilLDAPSettingsGUI::editRoleAssignment(), ilLDAPSettingsGUI::roleAssignments(), and ilLDAPSettingsGUI::updateRoleAssignment().
{
if(isset(self::$instances[$a_rule_id]))
{
return self::$instances[$a_rule_id];
}
return self::$instances[$a_rule_id] = new ilLDAPRoleAssignmentRule($a_rule_id);
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::_getRules | ( | ) |
Get all rules.
public
Definition at line 80 of file class.ilLDAPRoleAssignmentRule.php.
References $res, and _getInstanceByRuleId().
Referenced by ilLDAPSettingsGUI::roleAssignments().
{
global $ilDB;
$query = "SELECT rule_id FROM ldap_role_assignments ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$rules[] = self::_getInstanceByRuleId($row->rule_id);
}
return $rules ? $rules : array();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::conditionToString | ( | ) |
condition to string
public
Definition at line 295 of file class.ilLDAPRoleAssignmentRule.php.
References getAttributeName(), getAttributeValue(), getDN(), and getType().
{
switch($this->getType())
{
case self::TYPE_GROUP:
$dn_arr = explode(',',$this->getDN());
return $dn_arr[0];
case self::TYPE_ATTRIBUTE:
return $this->getAttributeName().'='.$this->getAttributeValue();
}
}
Here is the call graph for this function:| ilLDAPRoleAssignmentRule::create | ( | ) |
create
public
Definition at line 317 of file class.ilLDAPRoleAssignmentRule.php.
References $res, getAttributeName(), getAttributeValue(), getDN(), getMemberAttribute(), getRoleId(), getServerId(), getType(), and isMemberAttributeDN().
{
$query = "INSERT INTO ldap_role_assignments ".
"SET server_id = ".$this->db->quote($this->getServerId()).", ".
"type = ".$this->db->quote($this->getType()).", ".
"dn = ".$this->db->quote($this->getDN()).", ".
"attribute = ".$this->db->quote($this->getMemberAttribute()).", ".
"isdn = ".$this->db->quote($this->isMemberAttributeDN()).", ".
"att_name = ".$this->db->quote($this->getAttributeName()).", ".
"att_value = ".$this->db->quote($this->getAttributeValue()).", ".
"role_id = ".(int) $this->getRoleId()." ";
$res = $this->db->query($query);
$this->rule_id = $this->db->getLastInsertId();
return true;
}
Here is the call graph for this function:| ilLDAPRoleAssignmentRule::delete | ( | ) |
delete rule
public
Definition at line 406 of file class.ilLDAPRoleAssignmentRule.php.
References getRuleId().
{
$query = "DELETE FROM ldap_role_assignments ".
"WHERE rule_id = ".$this->db->quote($this->getRuleId())." ";
$this->db->query($query);
return true;
}
Here is the call graph for this function:| ilLDAPRoleAssignmentRule::getAttributeName | ( | ) |
get attribute name
public
Definition at line 261 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by conditionToString(), create(), ilLDAPSettingsGUI::initFormRoleAssignments(), update(), and validate().
{
return $this->attribute_name;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::getAttributeValue | ( | ) |
get atrtibute value
public
Definition at line 284 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by conditionToString(), create(), ilLDAPSettingsGUI::initFormRoleAssignments(), update(), and validate().
{
return $this->attribute_value;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::getDN | ( | ) |
get dn
public
Definition at line 192 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by conditionToString(), create(), ilLDAPSettingsGUI::initFormRoleAssignments(), update(), and validate().
{
return $this->dn;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::getMemberAttribute | ( | ) |
get attribute
public
Definition at line 215 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by create(), ilLDAPSettingsGUI::initFormRoleAssignments(), update(), and validate().
{
return $this->member_attribute;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::getRoleId | ( | ) |
get role id
public
Definition at line 111 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by create(), ilLDAPSettingsGUI::initFormRoleAssignments(), update(), and validate().
{
return $this->role_id;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::getRuleId | ( | ) |
get id
public
Definition at line 122 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by delete(), read(), and update().
{
return $this->rule_id;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::getServerId | ( | ) |
get server id
public
Definition at line 145 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by create(), and update().
{
return $this->server_id;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::getType | ( | ) |
getType
public
Definition at line 169 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by conditionToString(), create(), ilLDAPSettingsGUI::initFormRoleAssignments(), update(), and validate().
{
return $this->type;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::isMemberAttributeDN | ( | ) |
is member attribute dn
public
Definition at line 238 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by create(), ilLDAPSettingsGUI::initFormRoleAssignments(), and update().
{
return (bool) $this->member_is_dn;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::read | ( | ) | [private] |
load from db
private
Definition at line 420 of file class.ilLDAPRoleAssignmentRule.php.
References $res, getRuleId(), setAttributeName(), setAttributeValue(), setDN(), setMemberAttribute(), setMemberIsDN(), setRoleId(), setServerId(), and setType().
Referenced by __construct().
{
$query = "SELECT * FROM ldap_role_assignments ".
"WHERE rule_id = ".$this->db->quote($this->getRuleId())." ";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setServerId($row->server_id);
$this->setType($row->type);
$this->setDN($row->dn);
$this->setMemberAttribute($row->attribute);
$this->setMemberIsDN($row->isdn);
$this->setAttributeName($row->att_name);
$this->setAttributeValue($row->att_value);
$this->setRoleId($row->role_id);
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::setAttributeName | ( | $ | a_name | ) |
set attribute name
public
Definition at line 250 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by read().
{
$this->attribute_name = $a_name;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::setAttributeValue | ( | $ | a_value | ) |
set attribute value
public
| string | value |
Definition at line 273 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by read().
{
$this->attribute_value = $a_value;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::setDN | ( | $ | a_dn | ) |
set dn
public
| string | dn |
Definition at line 181 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by read().
{
$this->dn = $a_dn;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::setMemberAttribute | ( | $ | a_attribute | ) |
public
Definition at line 204 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by read().
{
$this->member_attribute = $a_attribute;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::setMemberIsDN | ( | $ | a_status | ) |
set member attribute is dn
public
| bool | status |
Definition at line 227 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by read().
{
$this->member_is_dn = $a_status;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::setRoleId | ( | $ | a_role_id | ) |
set role id
public
| int | role id of global role |
Definition at line 100 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by read().
{
$this->role_id = $a_role_id;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::setServerId | ( | $ | a_id | ) |
set server id
public
| int | server id |
Definition at line 134 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by read().
{
$this->server_id = $a_id;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::setType | ( | $ | a_type | ) |
set type
public
| int | type |
Definition at line 157 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by read().
{
$this->type = $a_type;
}
Here is the caller graph for this function:| ilLDAPRoleAssignmentRule::update | ( | ) |
update
public
Definition at line 340 of file class.ilLDAPRoleAssignmentRule.php.
References $res, getAttributeName(), getAttributeValue(), getDN(), getMemberAttribute(), getRoleId(), getRuleId(), getServerId(), getType(), and isMemberAttributeDN().
{
$query = "UPDATE ldap_role_assignments ".
"SET server_id = ".$this->db->quote($this->getServerId()).", ".
"type = ".$this->db->quote($this->getType()).", ".
"dn = ".$this->db->quote($this->getDN()).", ".
"attribute = ".$this->db->quote($this->getMemberAttribute()).", ".
"isdn = ".$this->db->quote($this->isMemberAttributeDN()).", ".
"att_name = ".$this->db->quote($this->getAttributeName()).", ".
"att_value = ".$this->db->quote($this->getAttributeValue()).", ".
"role_id = ".(int) $this->getRoleId()." ".
"WHERE rule_id = ".$this->db->quote($this->getRuleId())." ";
$res = $this->db->query($query);
$this->rule_id = $this->db->getLastInsertId();
return true;
}
Here is the call graph for this function:| ilLDAPRoleAssignmentRule::validate | ( | ) |
validate
public
Definition at line 365 of file class.ilLDAPRoleAssignmentRule.php.
References $ilErr, getAttributeName(), getAttributeValue(), getDN(), getMemberAttribute(), getRoleId(), and getType().
{
global $ilErr;
$ilErr->setMessage('');
if(!$this->getRoleId())
{
$ilErr->setMessage('fill_out_all_required_fields');
return false;
}
switch($this->getType())
{
case self::TYPE_GROUP:
if(!strlen($this->getDN()) or !strlen($this->getMemberAttribute()))
{
$ilErr->setMessage('fill_out_all_required_fields');
return false;
}
break;
case self::TYPE_ATTRIBUTE:
if(!strlen($this->getAttributeName()) or !strlen($this->getAttributeValue()))
{
$ilErr->setMessage('fill_out_all_required_fields');
return false;
}
break;
default:
$ilErr->setMessage('ldap_no_type_given');
return false;
}
return true;
}
Here is the call graph for this function:ilLDAPRoleAssignmentRule::$instances = null [static, private] |
Definition at line 34 of file class.ilLDAPRoleAssignmentRule.php.
| const ilLDAPRoleAssignmentRule::TYPE_ATTRIBUTE = 2 |
Definition at line 37 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by ilLDAPSettingsGUI::initFormRoleAssignments().
| const ilLDAPRoleAssignmentRule::TYPE_GROUP = 1 |
Definition at line 36 of file class.ilLDAPRoleAssignmentRule.php.
Referenced by ilLDAPSettingsGUI::initFormRoleAssignments(), and ilLDAPRoleAssignmentTableGUI::parse().
1.7.1