templates/3rdParty/pla/lib/schema_functions.php

Properties

Description

Classes and functions for fetching and parsing schema from an LDAP server.

Classes

SchemaItem

Properties

 
 
Schema  
Yes 
No 

Description

Generic parent class for all schema items. A schema item is an ObjectClass, an AttributeBype, a MatchingRule, or a Syntax.
All schema items have at least two things in common: An OID and a description. This class provides an implementation for these two data.

Methods

getDescription, getIsObsolete, getName, getOID, setDescription, setOID,

getDescription( ) : n/a

Return value

Type Description
n/a n/a

getIsObsolete( ) : n/a

Description

Gets whether this objectClass is flagged as obsolete by the LDAP server.

Return value

Type Description
n/a n/a

getName(   $lower = true, ) : string

Description

Return the objects name.
param boolean $lower Return the name in lower case (default)

Arguments

Name Type Description Default
$lower n/a true

Return value

Type Description
string The name

getOID( ) : n/a

Return value

Type Description
n/a n/a

setDescription(   $desc, ) : n/a

Arguments

Name Type Description Default
$desc n/a

Return value

Type Description
n/a n/a

setOID(   $oid, ) : n/a

Arguments

Name Type Description Default
$oid n/a

Return value

Type Description
n/a n/a

Properties

$description, $is_obsolete, $name, $oid,

  protected  $description = null




  private  $is_obsolete = false




  protected  $name = null




  private  $oid = null




ObjectClass

Properties

 
 
Schema  
No 
No 

Description

Represents an LDAP objectClass
All schema items have at least two things in common: An OID and a description. This class provides an implementation for these two data.

Methods

__construct, addChildObjectClass, addMayAttrs, addMustAttrs, getChildObjectClasses, getForceMayAttrs, getMayAttrNames, getMayAttrs, getMustAttrNames, getMustAttrs, getParents, getSupClasses, getType, isForceMay, isRelated, isStructural, parseList,

__construct(   $class,   $server, ) : n/a

Description

Creates a new ObjectClass object given a raw LDAP objectClass string.

Arguments

Name Type Description Default
$class n/a
$server n/a

Return value

Type Description
n/a n/a

addChildObjectClass( String   $name, ) : boolean

Description

Adds an objectClass to the list of objectClasses that inherit from this objectClass.

Arguments

Name Type Description Default
$name String

The name of the objectClass to add

Return value

Type Description
boolean Returns true on success or false on failure (objectclass already existed for example)

addMayAttrs( array   $attr, ) : n/a

Description

Behaves identically to addMustAttrs, but it operates on the MAY attributes of this objectClass.

Arguments

Name Type Description Default
$attr array

An array of attribute names (strings) to add.

Return value

Type Description
n/a n/a

addMustAttrs( array   $attr, ) : n/a

Description

Adds the specified array of attributes to this objectClass' list of MUST attributes. The resulting array of must attributes will contain unique members.

Arguments

Name Type Description Default
$attr array

An array of attribute names (strings) to add.

Return value

Type Description
n/a n/a

getChildObjectClasses( ) : Array

Description

Returns the array of objectClass names which inherit from this objectClass.

Return value

Type Description
Array Names of objectClasses which inherit from this objectClass.

getForceMayAttrs( ) : n/a

Return value

Type Description
n/a n/a

getMayAttrNames( array   $parents = false, ) : array

Description

Gets an array of attribute names (strings) that entries of this ObjectClass must define.
This differs from getMayAttrs in that it returns an array of strings rather than array of AttributeType objects

Arguments

Name Type Description Default
$parents array

An array of ObjectClass objects to use when traversing the inheritance tree. This presents some what of a bootstrapping problem as we must fetch all objectClasses to determine through inheritance which attributes this objectClass provides.

false

Return value

Type Description
array The array of allowed attribute names (strings).

Tags

Name Description
see
see
see

getMayAttrs( array   $parents = false, ) : array

Description

Gets an array of AttributeType objects that entries of this ObjectClass may define.
This differs from getMayAttrNames in that it returns an array of AttributeType objects

Arguments

Name Type Description Default
$parents array

An array of ObjectClass objects to use when traversing the inheritance tree. This presents some what of a bootstrapping problem as we must fetch all objectClasses to determine through inheritance which attributes this objectClass provides.

false

Return value

Type Description
array The array of allowed AttributeType objects.

Tags

Name Description
see
see
see
see

getMustAttrNames( array   $parents = false, ) : array

Description

Gets an array of attribute names (strings) that entries of this ObjectClass must define.
This differs from getMustAttrs in that it returns an array of strings rather than array of AttributeType objects

Arguments

Name Type Description Default
$parents array

An array of ObjectClass objects to use when traversing the inheritance tree. This presents some what of a bootstrapping problem as we must fetch all objectClasses to determine through inheritance which attributes this objectClass provides.

false

Return value

Type Description
array The array of allowed attribute names (strings).

Tags

Name Description
see
see
see

getMustAttrs( array   $parents = false, ) : array

Description

Gets an array of AttributeType objects that entries of this ObjectClass must define.
This differs from getMustAttrNames in that it returns an array of AttributeType objects

Arguments

Name Type Description Default
$parents array

An array of ObjectClass objects to use when traversing the inheritance tree. This presents some what of a bootstrapping problem as we must fetch all objectClasses to determine through inheritance which attributes this objectClass requires.

false

Return value

Type Description
array The array of required AttributeType objects.

Tags

Name Description
see
see
see

getParents( ) : n/a

Description

This will return all our parent ObjectClass Objects

Return value

Type Description
n/a n/a

getSupClasses( ) : array

Description

Gets the objectClass names from which this objectClass inherits.

Return value

Type Description
array An array of objectClass names (strings)

getType( ) : n/a

Description

Gets the type of this objectClass: STRUCTURAL, ABSTRACT, or AUXILIARY.

Return value

Type Description
n/a n/a

isForceMay(   $attr, ) : n/a

Description

Determine if an array is listed in the force_may attrs

Arguments

Name Type Description Default
$attr n/a

Return value

Type Description
n/a n/a

isRelated(   $oclass, ) : n/a

Description

Return if this objectClass is related to $oclass

Arguments

Name Type Description Default
$oclass n/a

Return value

Type Description
n/a n/a

isStructural( ) : n/a

Return value

Type Description
n/a n/a

parseList(   $i,   $strings,   $attrs, ) : n/a

Description

Parse an LDAP schema list

Arguments

Name Type Description Default
$i n/a
$strings n/a
$attrs n/a

Return value

Type Description
n/a n/a

Properties

$children_objectclasses, $force_may, $hierarchy, $may_attrs, $must_attrs, $server_id, $sup_classes, $type,

  private  $children_objectclasses = array()




  private  $force_may = array()




  private  $hierarchy = array()




  private  $may_attrs = array()




  private  $must_attrs = array()




  private  $server_id = null




  private  $sup_classes = array()




  private  $type =




ObjectClass_ObjectClassAttribute

Properties

 
 
Schema  
No 
No 

Description

A simple class for representing AttributeTypes used only by the ObjectClass class.
Users should never instantiate this class. It represents an attribute internal to an ObjectClass. If PHP supported inner-classes and variable permissions, this would be interior to class ObjectClass and flagged private. The reason this class is used and not the "real" class AttributeType is because this class supports the notion of a "source" objectClass, meaning that it keeps track of which objectClass originally specified it. This class is therefore used by the class ObjectClass to determine inheritance.

Methods

__construct, getName, getSource,

__construct( string   $name, string   $source, ) : n/a

Description

Creates a new ObjectClass_ObjectClassAttribute with specified name and source objectClass.

Arguments

Name Type Description Default
$name string

the name of the new attribute.

$source string

the name of the ObjectClass which specifies this attribute.

Return value

Type Description
n/a n/a

getName(   $lower = true, ) : n/a

Arguments

Name Type Description Default
$lower n/a true

Return value

Type Description
n/a n/a

getSource( ) : n/a

Return value

Type Description
n/a n/a

Properties

$name, $source,

  public  $name =




  public  $source =




AttributeType

Properties

 
 
Schema  
No 
No 

Description

Represents an LDAP AttributeType
All schema items have at least two things in common: An OID and a description. This class provides an implementation for these two data.

Methods

__construct, addAlias, addRequiredByObjectClass, addUsedInObjectClass, getAliases, getEquality, getIsCollective, getIsNoUserModification, getIsSingleValue, getMaxLength, getOrdering, getRequiredByObjectClasses, getSubstr, getSupAttribute, getSyntaxOID, getSyntaxString, getType, getUsage, getUsedInObjectClasses, isAliasFor, isForceMay, removeAlias, setAliases, setForceMay, setIsSingleValue, setName, setSupAttribute, setType,

__construct(   $attr, ) : n/a

Description

Creates a new AttributeType object from a raw LDAP AttributeType string.

Arguments

Name Type Description Default
$attr n/a

Return value

Type Description
n/a n/a

addAlias( string   $alias, ) : n/a

Description

Adds an attribute name to the alias array.

Arguments

Name Type Description Default
$alias string

The name of a new attribute to add to this attribute's list of aliases.

Return value

Type Description
n/a n/a

addRequiredByObjectClass( string   $name, ) : n/a

Description

Adds an objectClass name to this attribute's list of "required by" objectClasses, that is the list of objectClasses which must have this attribute.

Arguments

Name Type Description Default
$name string

The name of the objectClass to add.

Return value

Type Description
n/a n/a

addUsedInObjectClass( string   $name, ) : n/a

Description

Adds an objectClass name to this attribute's list of "used in" objectClasses, that is the list of objectClasses which provide this attribute.

Arguments

Name Type Description Default
$name string

The name of the objectClass to add.

Return value

Type Description
n/a n/a

getAliases( ) : array

Description

Gets the names of attributes that are an alias for this attribute (if any).

Return value

Type Description
array An array of names of attributes which alias this attribute or an empty array if no attribute aliases this object.

getEquality( ) : string

Description

Gets this attribute's equality string

Return value

Type Description
string

getIsCollective( ) : boolean

Description

Gets whether this attribute is collective.

Return value

Type Description
boolean Returns true if this attribute is collective and false otherwise.

getIsNoUserModification( ) : boolean

Description

Gets whether this attribute is not modifiable by users.

Return value

Type Description
boolean Returns true if this attribute is not modifiable by users.

getIsSingleValue( ) : boolean

Description

Gets whether this attribute is single-valued. If this attribute only supports single values, true is returned. If this attribute supports multiple values, false is returned.

Return value

Type Description
boolean Returns true if this attribute is single-valued or false otherwise.

getMaxLength( ) : int

Description

Gets this attribute's the maximum length. If no maximum is defined by the LDAP server, null is returned.

Return value

Type Description
int The maximum length (in characters) of this attribute or null if no maximum is specified.

getOrdering( ) : string

Description

Gets this attribute's ordering specification.

Return value

Type Description
string

getRequiredByObjectClasses( ) : array

Description

Gets the list of "required by" objectClasses, that is the list of objectClasses which provide must have attribute.

Return value

Type Description
array An array of names of objectclasses (strings) which provide this attribute

getSubstr( ) : string

Description

Gets this attribute's substring matching specification

Return value

Type Description
string

getSupAttribute( ) : string

Description

Gets this attribute's parent attribute (if any). If this attribute does not inherit from another attribute, null is returned.

Return value

Type Description
string

getSyntaxOID( ) : string

Description

Gets this attribute's syntax OID. Differs from getSyntaxString() in that this function only returns the actual OID with any length specification removed.
Ie, if the syntax string is "1.2.3.4{16}", this function only retruns "1.2.3.4".

Return value

Type Description
string The syntax OID string.

getSyntaxString( ) : string

Description

Gets this attribute's raw syntax string (ie: "1.2.3.4{16}").

Return value

Type Description
string The raw syntax string

getType( ) : string

Description

Gets this attribute's type

Return value

Type Description
string The attribute's type.

getUsage( ) : string

Description

Gets this attribute's usage string as defined by the LDAP server

Return value

Type Description
string

getUsedInObjectClasses( ) : array

Description

Gets the list of "used in" objectClasses, that is the list of objectClasses which provide this attribute.

Return value

Type Description
array An array of names of objectclasses (strings) which provide this attribute

isAliasFor( string   $attr_name, ) : boolean

Description

Returns whether the specified attribute is an alias for this one (based on this attribute's alias list).

Arguments

Name Type Description Default
$attr_name string

The name of the attribute to check.

Return value

Type Description
boolean True if the specified attribute is an alias for this one, or false otherwise.

isForceMay( ) : n/a

Return value

Type Description
n/a n/a

removeAlias( string   $remove_alias_name, ) : boolean

Description

Removes an attribute name from this attribute's alias array.

Arguments

Name Type Description Default
$remove_alias_name string

The name of the attribute to remove.

Return value

Type Description
boolean true on success or false on failure (ie, if the specified attribute name is not found in this attribute's list of aliases)

setAliases( array   $aliases, ) : n/a

Description

Sets this attribute's list of aliases.

Arguments

Name Type Description Default
$aliases array

The array of alias names (strings)

Return value

Type Description
n/a n/a

setForceMay( ) : n/a

Description

This function will mark this attribute as a forced MAY attribute

Return value

Type Description
n/a n/a

setIsSingleValue( boolean   $is, ) : n/a

Description

Sets whether this attribute is single-valued.

Arguments

Name Type Description Default
$is boolean

Return value

Type Description
n/a n/a

setName( string   $name, ) : n/a

Description

Sets this attriute's name.

Arguments

Name Type Description Default
$name string

The new name to give this attribute.

Return value

Type Description
n/a n/a

setSupAttribute( string   $attr, ) : n/a

Description

Sets this attriute's SUP attribute (ie, the attribute from which this attribute inherits).

Arguments

Name Type Description Default
$attr string

The name of the new parent (SUP) attribute

Return value

Type Description
n/a n/a

setType( string   $type, ) : n/a

Description

Sets this attribute's type.

Arguments

Name Type Description Default
$type string

The new type.

Return value

Type Description
n/a n/a

Properties

$aliases, $equality, $forced_as_may, $is_collective, $is_no_user_modification, $is_single_value, $max_length, $ordering, $required_by_object_classes, $sub_str, $sup_attribute, $syntax, $syntax_oid, $type, $usage, $used_in_object_classes,

  private  $aliases = array()




  private  $equality = null




  private  $forced_as_may = false




  private  $is_collective = false




  private  $is_no_user_modification = false




  private  $is_single_value = false




  private  $max_length = null




  private  $ordering = null




  private  $required_by_object_classes = array()




  private  $sub_str = null




  private  $sup_attribute = null




  private  $syntax = null




  private  $syntax_oid = null




  private  $type = null




  private  $usage = null




  private  $used_in_object_classes = array()




Syntax

Properties

 
 
Schema  
No 
No 

Description

Represents an LDAP Syntax
All schema items have at least two things in common: An OID and a description. This class provides an implementation for these two data.

Methods

__construct,

__construct(   $class, ) : n/a

Description

Creates a new Syntax object from a raw LDAP syntax string.

Arguments

Name Type Description Default
$class n/a

Return value

Type Description
n/a n/a

MatchingRule

Properties

 
 
Schema  
No 
No 

Description

Represents an LDAP MatchingRule
All schema items have at least two things in common: An OID and a description. This class provides an implementation for these two data.

Methods

__construct, addUsedByAttr, getUsedByAttrs, setUsedByAttrs,

__construct(   $strings, ) : n/a

Description

Creates a new MatchingRule object from a raw LDAP MatchingRule string.

Arguments

Name Type Description Default
$strings n/a

Return value

Type Description
n/a n/a

addUsedByAttr(   $attr, ) : true

Description

Adds an attribute name to the list of attributes who use this MatchingRule

Arguments

Name Type Description Default
$attr n/a

Return value

Type Description
true if the attribute was added and false otherwise (already in the list)

getUsedByAttrs( ) : array

Description

Gets an array of attribute names (strings) which use this MatchingRule

Return value

Type Description
array The array of attribute names (strings).

setUsedByAttrs( array   $attrs, ) : n/a

Description

Sets the list of used_by_attrs to the array specified by $attrs;

Arguments

Name Type Description Default
$attrs array

The array of attribute names (strings) which use this MatchingRule

Return value

Type Description
n/a n/a

Properties

$syntax, $used_by_attrs,

  private  $syntax = null




  private  $used_by_attrs = array()




MatchingRuleUse

Properties

 
 
Schema  
No 
No 

Description

Represents an LDAP schema matchingRuleUse entry
All schema items have at least two things in common: An OID and a description. This class provides an implementation for these two data.

Methods

__construct, getUsedByAttrs,

__construct(   $strings, ) : n/a

Arguments

Name Type Description Default
$strings n/a

Return value

Type Description
n/a n/a

getUsedByAttrs( ) : array

Description

Gets an array of attribute names (strings) which use this MatchingRuleUse object.

Return value

Type Description
array The array of attribute names (strings).

Properties

$used_by_attrs,

  private  $used_by_attrs = array()




Documentation was generated by phpDocumentor 2.0.1 .

Namespaces

  • global

    Packages