# LDAP Account Manager

# lib/schema.inc

# Properties

author
author
package

## Description

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

## Functions

### _get_schema_dn( string $dn, bool $debug = false, ) : string

#### Description

Helper for _get_raw_schema() which fetches the DN of the schema object in an LDAP server based on a DN. Entries should set the subSchemaSubEntry attribute pointing to the DN of the server schema. You can specify the DN whose subSchemaSubEntry you wish to retrieve of specify an empty string to fetch the subScehamSubEntry from the Root DSE.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$dn | string | The DN (may be null) which houses the subschemaSubEntry attribute which this function can use to determine the schema entry's DN. |
$debug | bool | Switch to true to see some nice and copious output. :) | false

#### Return value

Type | Description
--- | ---
string | The DN of the entry which houses this LDAP server&#039;s schema.

### _get_raw_schema( $schema_to_fetch, $dn = '', ) : \an

#### Description

Fetches the raw schema array for the subschemaSubentry of the server. Note, this function has grown many hairs to accomodate more LDAP servers. It is needfully complicated as it now supports many popular LDAP servers that don't necessarily expose their schema "the right way".

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$schema_to_fetch | n/a | A string indicating which type of schema to fetch. Five valid values: 'objectclasses', 'attributetypes', 'ldapsyntaxes', 'matchingruleuse', or 'matchingrules'. Case insensitive. |
$dn | n/a | (optional) This paremeter is the DN of the entry whose schema you would like to fetch. Entries have the option of specifying their own subschemaSubentry that points to the DN of the system schema entry which applies to this attribute. If unspecified, this will try to retrieve the schema from the RootDSE subschemaSubentry. Failing that, we use some commonly known schema DNs. Default value is the Root DSE DN (zero-length string) | ''

#### Return value

Type | Description
--- | ---
\an | array of strings of this form: Array ( [0] =&gt; &quot;( 1.3.6.1.4.1.7165.1.2.2.4 NAME &#039;gidPool&#039; DESC &#039;Pool ... [1] =&gt; &quot;( 1.3.6.1.4.1.7165.2.2.3 NAME &#039;sambaAccount&#039; DESC &#039;Sa ... etc.

### get_schema_objectclasses( string $dn = null, $use_cache = true, ) : array

#### Description

Gets an associative array of ObjectClass objects for the specified server. Each array entry's key is the name of the objectClass in lower-case and the value is an ObjectClass object.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$dn | string | (optional) It is easier to fetch schema if a DN is provided which defines the subschemaSubEntry attribute (all entries should). | null
$use_cache | n/a |  | true

#### Return value

Type | Description
--- | ---
array | An array of ObjectClass objects.

#### Tags

Name | Description
--- | ---
see |
see |

### get_schema_objectclass( string $oclass_name, string $dn = null, $use_cache = true, ) : \ObjectClass

#### Description

Gets a single ObjectClass object specified by name.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$oclass_name | string | The name of the objectClass to fetch. |
$dn | string | (optional) It is easier to fetch schema if a DN is provided which defines the subschemaSubEntry attribute (all entries should). | null
$use_cache | n/a |  | true

#### Return value

Type | Description
--- | ---
\ObjectClass | The specified ObjectClass object or false on error.

#### Tags

Name | Description
--- | ---
see |
see |

### get_schema_attribute( $attr_name, string $dn = null, $use_cache = true, ) : \AttributeType

#### Description

Gets a single AttributeType object specified by name.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$attr_name | n/a |  |
$dn | string | (optional) It is easier to fetch schema if a DN is provided which defines the subschemaSubEntry attribute (all entries should). | null
$use_cache | n/a |  | true

#### Return value

Type | Description
--- | ---
\AttributeType | The specified AttributeType object or false on error.

#### Tags

Name | Description
--- | ---
see |
see |

### get_schema_attributes( string $dn = null, $use_cache = true, ) : array

#### Description

Gets an associative array of AttributeType objects for the specified server. Each array entry's key is the name of the attributeType in lower-case and the value is an AttributeType object.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$dn | string | (optional) It is easier to fetch schema if a DN is provided which defines the subschemaSubEntry attribute (all entries should). | null
$use_cache | n/a |  | true

#### Return value

Type | Description
--- | ---
array | An array of AttributeType objects.

### add_aliases_to_attrs( $attrs, ) : n/a

#### Description

For each attribute that has multiple names, this function adds unique entries to the attrs array for those names. Ie, attributeType has name 'gn' and 'givenName'.
This function will create a unique entry for 'gn' and 'givenName'.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$attrs | n/a |  |

#### Return value

Type | Description
--- | ---
n/a | n/a

### add_sup_to_attrs( $attrs, $attrs_oid, ) : n/a

#### Description

Adds inherited values to each attributeType specified by the SUP directive.
Supports infinite levels of inheritance. Bug 856832: require a second paramter that has all attributes indexed by OID

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$attrs | n/a |  |
$attrs_oid | n/a |  |

#### Return value

Type | Description
--- | ---
n/a | n/a

### get_schema_matching_rules( $dn = null, $use_cache = true, ) : n/a

#### Description

Returns an array of MatchingRule objects for the specified server.
The key of each entry is the OID of the matching rule.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$dn | n/a |  | null
$use_cache | n/a |  | true

#### Return value

Type | Description
--- | ---
n/a | n/a

### get_schema_syntaxes( $dn = null, $use_cache = true, ) : n/a

#### Description

Returns an array of Syntax objects that this LDAP server uses mapped to their descriptions. The key of each entry is the OID of the Syntax.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$dn | n/a |  | null
$use_cache | n/a |  | true

#### Return value

Type | Description
--- | ---
n/a | n/a

### cached_schema_available( $schema_type, ) : n/a

#### Description

Returns true if the schema for $schema_type has been cached and is availble. $schema_type may be one of (lowercase) the following: objectclasses attributetypes ldapsyntaxes matchingrules matchingruleuse Note that _get_raw_schema() takes a similar parameter.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$schema_type | n/a |  |

#### Return value

Type | Description
--- | ---
n/a | n/a

### get_cached_schema( $schema_type, ) : n/a

#### Description

Returns the cached array of schemaitem objects for the specified $schema_type. For list of valid $schema_type values, see above schema_cache_available(). Note that internally, this function utilizes a two-layer cache, one in memory using a static variable for multiple calls within the same page load, and one in a session for multiple calls within the same user session (spanning multiple page loads).
Returns an array of SchemaItem objects on success or false on failure.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$schema_type | n/a |  |

#### Return value

Type | Description
--- | ---
n/a | n/a

### set_cached_schema( $schema_type, $schema_items, ) : n/a

#### Description

Caches the specified $schema_type.
$schema_items should be an array of SchemaItem instances (ie, an array of ObjectClass, AttributeType, LDAPSyntax, MatchingRuleUse, or MatchingRule objects. Returns true on success of false on failure.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$schema_type | n/a |  |
$schema_items | n/a |  |

#### Return value

Type | Description
--- | ---
n/a | n/a

### set_schema_cache_unavailable( ) : n/a

#### Description

Sets the schema entry for the server_id to be "unavailable" so that we realize that we tried to get the schema but could not, so quit trying next time to fetch it from the server.

#### Return value

Type | Description
--- | ---
n/a | n/a

## Constants

### SCHEMA_SESSION_CACHE_ENABLED = 1

## Classes

### SchemaItem

# Properties

Extends
Implements
package
lib
Abstract
No
Final
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

SchemaItem, getDescription, getOID, initVars, setDescription, setOID,

### SchemaItem( ) : n/a

#### Description

Default constructor.

#### Return value

Type | Description
--- | ---
n/a | n/a

### getDescription( ) : n/a

#### Return value

Type | Description
--- | ---
n/a | n/a

### getOID( ) : n/a

#### Return value

Type | Description
--- | ---
n/a | n/a

### initVars( ) : n/a

#### Description

Initialize class members to default values.

#### Return value

Type | Description
--- | ---
n/a | n/a

### setDescription( $new_desc, ) : n/a

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$new_desc | n/a |  |

#### Return value

Type | Description
--- | ---
n/a | n/a

### setOID( $new_oid, ) : n/a

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$new_oid | n/a |  |

#### Return value

Type | Description
--- | ---
n/a | n/a

#### Properties

$description, $oid,

### public $description =

The description of this schema item.

### public $oid =

The OID of this schema item.

### ObjectClass

# Properties

Extends
Implements
package
lib
Abstract
No
Final
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

ObjectClass, addChildObjectClass, addMayAttrs, addMustAttrs, getChildObjectClasses, getIsObsolete, getMayAttrNames, getMayAttrs, getMustAttrNames, getMustAttrs, getName, getSupClasses, getType, initVars,

### ObjectClass( $raw_ldap_schema_string, ) : n/a

#### Description

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

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$raw_ldap_schema_string | n/a |  |

#### Return value

Type | Description
--- | ---
n/a | n/a

### addChildObjectClass( String $object_class_name, ) : bool

#### Description

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

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$object_class_name | String | The name of the objectClass to add |

#### Return value

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

### addMayAttrs( array $new_may_attrs, ) : n/a

#### Description

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

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$new_may_attrs | array | An array of attribute names (strings) to add. |

#### Return value

Type | Description
--- | ---
n/a | n/a

### addMustAttrs( array $new_must_attrs, ) : 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
--- | --- | --- | ---
$new_must_attrs | 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.

### getIsObsolete( ) : n/a

#### Description

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

#### Return value

Type | Description
--- | ---
n/a | n/a

### getMayAttrNames( array $oclasses = null, ) : 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
--- | --- | --- | ---
$oclasses | 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. | null

#### Return value

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

#### Tags

Name | Description
--- | ---
see |
see |
see |

### getMayAttrs( array $oclasses = NULL, ) : 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
--- | --- | --- | ---
$oclasses | 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. | NULL

#### Return value

Type | Description
--- | ---
array | The array of allowed AttributeType objects.

#### Tags

Name | Description
--- | ---
see |
see |
see |
see |

### getMustAttrNames( array $oclasses = null, ) : 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
--- | --- | --- | ---
$oclasses | 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. | null

#### Return value

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

#### Tags

Name | Description
--- | ---
see |
see |
see |

### getMustAttrs( array $oclasses = NULL, ) : 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
--- | --- | --- | ---
$oclasses | 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. | NULL

#### Return value

Type | Description
--- | ---
array | The array of required AttributeType objects.

#### Tags

Name | Description
--- | ---
see |
see |
see |

### getName( ) : string

#### Description

Gets the name of this objectClass (ie, "inetOrgPerson")

#### Return value

Type | Description
--- | ---
string | The name of the objectClass

### 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

### initVars( ) : n/a

#### Description

Initialize the class' member variables

#### Return value

Type | Description
--- | ---
n/a | n/a

#### Properties

$children_objectclasses, $is_obsolete, $may_attrs, $must_attrs, $name, $sup_classes, $type,

### public $children_objectclasses =

array of objectClasses which inherit from this one (must be set at runtime explicitly by the caller)

### public $is_obsolete =

boolean value indicating whether this objectClass is obsolete

### public $may_attrs =

arrays of attribute names that this objectClass allows, but does not require

### public $must_attrs =

arrays of attribute names that this objectClass requires

### public $name =

This objectClass' name, ie "inetOrgPerson"

### public $sup_classes =

array of objectClass names from which this objectClass inherits

### public $type =

one of STRUCTURAL, ABSTRACT, or AUXILIARY

### ObjectClassAttribute

# Properties

Extends
Implements
package
lib
Abstract
No
Final
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

ObjectClassAttribute, getName, getSource,

### ObjectClassAttribute( string $name, string $source, ) : n/a

#### Description

Creates a new 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( ) : n/a

#### Description

Gets this attribute's name

#### Return value

Type | Description
--- | ---
n/a | n/a

### getSource( ) : n/a

#### Description

Gets the name of the ObjectClass which originally specified this attribute.

#### Return value

Type | Description
--- | ---
n/a | n/a

#### Properties

$name, $source,

### public $name =

This Attribute's name

### public $source =

This Attribute's root

### AttributeType

# Properties

Extends
Implements
package
lib
Abstract
No
Final
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

AttributeType, addAlias, addRequiredByObjectClass, addUsedInObjectClass, getAliases, getEquality, getIsCollective, getIsNoUserModification, getIsObsolete, getIsSingleValue, getMaxLength, getName, getOrdering, getRequiredByObjectClasses, getSubstr, getSupAttribute, getSyntaxOID, getSyntaxString, getType, getUsage, getUsedInObjectClasses, initVars, isAliasFor, removeAlias, setAliases, setIsSingleValue, setName, setSupAttribute, setType,

### AttributeType( $raw_ldap_attr_string, ) : n/a

#### Description

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

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$raw_ldap_attr_string | n/a |  |

#### Return value

Type | Description
--- | ---
n/a | n/a

### addAlias( string $new_alias_name, ) : n/a

#### Description

Adds an attribute name to the alias array.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$new_alias_name | 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 $object_class_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
--- | --- | --- | ---
$object_class_name | string | The name of the objectClass to add. |

#### Return value

Type | Description
--- | ---
n/a | n/a

### addUsedInObjectClass( string $object_class_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
--- | --- | --- | ---
$object_class_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( ) : bool

#### Description

Gets whether this attribute is collective.

#### Return value

Type | Description
--- | ---
bool | Returns true if this attribute is collective and false otherwise.

### getIsNoUserModification( ) : bool

#### Description

Gets whether this attribute is not modifiable by users.

#### Return value

Type | Description
--- | ---
bool | Returns true if this attribute is not modifiable by users.

### getIsObsolete( ) : bool

#### Description

Gets whether this attribute has been flagged as obsolete by the LDAP server

#### Return value

Type | Description
--- | ---
bool |

### getIsSingleValue( ) : bool

#### 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
--- | ---
bool | 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.

### getName( ) : string

#### Description

Gets this attribute's name

#### Return value

Type | Description
--- | ---
string |

### 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&#039;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

### initVars( ) : n/a

#### Description

Initialize the class' member variables

#### Return value

Type | Description
--- | ---
n/a | n/a

### isAliasFor( string $attr_name, ) : bool

#### 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
--- | ---
bool | True if the specified attribute is an alias for this one, or false otherwise.

### removeAlias( string $remove_alias_name, ) : bool

#### 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
--- | ---
bool | true on success or false on failure (ie, if the specified attribute name is not found in this attribute&#039;s list of aliases)

### setAliases( array $new_aliases, ) : n/a

#### Description

Sets this attribute's list of aliases.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$new_aliases | array | The array of alias names (strings) |

#### Return value

Type | Description
--- | ---
n/a | n/a

### setIsSingleValue( bool $is_single_value, ) : n/a

#### Description

Sets whether this attribute is single-valued.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$is_single_value | bool |  |

#### Return value

Type | Description
--- | ---
n/a | n/a

### setName( string $new_name, ) : n/a

#### Description

Sets this attriute's name.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$new_name | string | The new name to give this attribute. |

#### Return value

Type | Description
--- | ---
n/a | n/a

### setSupAttribute( string $new_sup_attr, ) : n/a

#### Description

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

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$new_sup_attr | string | The name of the new parent (SUP) attribute |

#### Return value

Type | Description
--- | ---
n/a | n/a

### setType( string $new_type, ) : n/a

#### Description

Sets this attribute's type.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$new_type | string | The new type. |

#### Return value

Type | Description
--- | ---
n/a | n/a

#### Properties

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

### public $aliases =

An array of alias attribute names, strings

### public $equality =

The equality rule used

### public $is_collective =

boolean: is collective?

### public $is_no_user_modification =

boolean: can use modify?

### public $is_obsolete =

string: the description

### public $is_single_value =

boolean: is single valued only?

### public $max_length =

The max number of characters this attribute can be

### public $name =

The name of this attributeType

### public $ordering =

The ordering of the attributeType

### public $required_by_object_classes = array()

A list of object class names that require this attribute type.

### public $sub_str =

Boolean: supports substring matching?

### public $sup_attribute =

The attribute from which this attribute inherits (if any)

### public $syntax =

The full syntax string, ie 1.2.3.4{16}

### public $type =

A string description of the syntax type (taken from the LDAPSyntaxes)

### public $usage =

The usage string set by the LDAP schema

### public $used_in_object_classes =

An array of objectClasses which use this attributeType (must be set by caller)

### Syntax

# Properties

Extends
Implements
package
lib
Abstract
No
Final
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

Syntax, initVars,

### Syntax( $raw_ldap_syntax_string, ) : n/a

#### Description

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

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$raw_ldap_syntax_string | n/a |  |

#### Return value

Type | Description
--- | ---
n/a | n/a

### initVars( ) : n/a

#### Description

Initializes the class' member variables

#### Return value

Type | Description
--- | ---
n/a | n/a

### MatchingRule

# Properties

Extends
Implements
package
lib
Abstract
No
Final
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

MatchingRule, addUsedByAttr, getIsObsolete, getName, getUsedByAttrs, initVars, setUsedByAttrs,

### MatchingRule( $raw_ldap_matching_rule_string, ) : n/a

#### Description

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

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$raw_ldap_matching_rule_string | n/a |  |

#### Return value

Type | Description
--- | ---
n/a | n/a

### addUsedByAttr( $new_attr_name, ) : true

#### Description

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

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$new_attr_name | n/a |  |

#### Return value

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

### getIsObsolete( ) : bool

#### Description

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

#### Return value

Type | Description
--- | ---
bool | True if this MatchingRule is obsolete and false otherwise.

### getName( ) : string

#### Description

Gets this MatchingRule's name.

#### Return value

Type | Description
--- | ---
string | The name.

### 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).

### initVars( ) : n/a

#### Description

Initialize the class' member variables

#### Return value

Type | Description
--- | ---
n/a | n/a

### 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

$is_obsolete, $name, $syntax, $used_by_attrs,

### public $is_obsolete =

Boolean value indicating whether this MatchingRule is obsolete

### public $name =

This rule's name

### public $syntax =

This rule's syntax OID

### public $used_by_attrs =

An array of attribute names who use this MatchingRule

### MatchingRuleUse

# Properties

Extends
Implements
package
lib
Abstract
No
Final
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

MatchingRuleUse, getName, getUsedByAttrs, initVars,

### MatchingRuleUse( $raw_matching_rule_use_string, ) : n/a

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$raw_matching_rule_use_string | n/a |  |

#### Return value

Type | Description
--- | ---
n/a | n/a

### getName( ) : string

#### Description

Gets this MatchingRuleUse's name

#### Return value

Type | Description
--- | ---
string | The name

### 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).

### initVars( ) : n/a

#### Description

Initialize the class' member variables

#### Return value

Type | Description
--- | ---
n/a | n/a

#### Properties

$name, $used_by_attrs,

### public $name =

The name of the MathingRule this applies to

### public $used_by_attrs =

An array of attributeType names who make use of the mathingRule identified by $this->oid and $this->name
Documentation was generated by phpDocumentor 2.0.1 .

# Namespaces

- global

# Packages

- Crypt_AES
  - Crypt_AES
    Pure-PHP implementation of AES.
- Crypt_DES
  - Crypt_DES
    Pure-PHP implementation of DES.
- Crypt_Hash
  - Crypt_Hash
    Pure-PHP implementations of keyed-hash message authentication codes (HMACs) and various cryptographic hashing functions.
- Crypt_RC4
  - Crypt_RC4
    Pure-PHP implementation of RC4.
- Crypt_RSA
  - Crypt_RSA
    Pure-PHP PKCS#1 compliant implementation of RSA.
- Crypt_Random
- Crypt_Rijndael
  - Crypt_Rijndael
    Pure-PHP implementation of Rijndael.
- Crypt_TerraDES
  - Crypt_TripleDES
    Pure-PHP implementation of Triple DES.
- Crypt_TripleDES
- Help
- LDAP
  - Ldap
    Ldap manages connection to LDAP and includes several helper functions.
- Math_BigInteger
  - Math_BigInteger
    Pure-PHP arbitrary precision integer arithmetic library. Supports base-2, base-10, base-16, and base-256 numbers.
- Net_SFTP
  - Net_SFTP
    Pure-PHP implementations of SFTP.
- Net_SSH1
  - Net_SSH1
    Pure-PHP implementation of SSHv1.
- Net_SSH2
  - Net_SSH2
    Pure-PHP implementation of SSHv2.
- PDF
  - UFPDF
    Main UFPDF class for creating Unicode PDF documents
  - lamPDF
    Creates a LAM information page in PDF format.
  - xmlParser
    Simple XML parser.
- PHP_Compat
- configuration
  - LAMCfgMain
    This class manages config.cfg.
  - LAMConfig
    This class manages .conf files.
- horde.cipher
  - Horde_Cipher_blowfish
- lam
  - smbHash
    Calculates NT and LM hashes.
- lib
  - AttributeType
    Represents an LDAP AttributeType
  - MatchingRule
    Represents an LDAP MatchingRule
  - MatchingRuleUse
    Represents an LDAP schema matchingRuleUse entry
  - ObjectClass
    Represents an LDAP objectClass
  - ObjectClassAttribute
    A simple class for representing AttributeTypes used only by the ObjectClass class.
  - SchemaItem
    Generic parent class for all schema items. A schema item is an ObjectClass, an AttributeBype, a MatchingRule, or a Syntax.
  - Syntax
    Represents an LDAP Syntax
- lists
  - lamAsteriskExtList
    Generates the list view.
  - lamBooleanListOption
    Boolean option for list configuration.
  - lamDHCPList
    Generates the list view.
  - lamGroupList
    Generates the list view.
  - lamHostList
    Generates the list view.
  - lamList
    Generates the list view.
  - lamListOption
    Represents a list configuration option.
  - lamListTool
    Represents a tool which can be included in the account lists.
  - lamMailAliasList
    Generates the list view.
  - lamNetgroupList
    Generates the list view.
  - lamSelectListOption
    Boolean option for list configuration.
  - lamSmbDomainList
    Generates the list view.
  - lamUserList
    Generates the list view.
- main
- metaHTML
  - htmlAccountPageButton
    Prints a button for the account pages.
  - htmlButton
    Simple button.
  - htmlDiv
    Creates a simple DIV element.
  - htmlElement
    Represents a HTML element.
  - htmlEqualHeight
    Sets all given elements to the same height.
  - htmlEqualWidth
    Sets all given elements to the same width.
  - htmlFieldset
    Generates a fieldset.
  - htmlGroup
    Groups multiple htmlElements.
  - htmlHelpLink
    Renders a help link.
  - htmlHiddenInput
    Generates a hidden input field.
  - htmlHorizontalLine
    Prints a horizontal line.
  - htmlImage
    Prints the HTML code for an image.
  - htmlInputCheckbox
    Prints the HTML code for a checkbox.
  - htmlInputField
    A standard input field.
  - htmlInputFileUpload
    Prints the HTML code for a file upload field.
  - htmlInputTextarea
    Prints the HTML code for a textarea.
  - htmlJavaScript
    Creates a JavaScript element.
  - htmlLink
    Generates a link.
  - htmlOutputText
    Prints the text and escapes contained HTML code by default.
  - htmlRadio
    Represents a radio selection.
  - htmlSelect
    Represents a select box.
  - htmlSortableList
    Creates a list of elements that can be sorted by the user via drag'n'drop.
  - htmlSpacer
    Adds an empty space with given width and height.
  - htmlStatusMessage
    Prints a status message (e.g. error message).
  - htmlSubTitle
    Generates a subtitle line. This is used to group multiple fields.
  - htmlTable
    Structures elements using a table.
  - htmlTableExtendedInputCheckbox
    Checkbox with descriptive label and help link.
  - htmlTableExtendedInputField
    An extended input field that combines label, input field and help.
  - htmlTableExtendedInputFileUpload
    File upload with descriptive label and help link.
  - htmlTableExtendedInputTextarea
    Text area with label and help link.
  - htmlTableExtendedRadio
    Radio list with descriptive label and help link.
  - htmlTableExtendedSelect
    Select with label and help link.
  - htmlTableRow
    A row inside a htmlTable.
  - htmlTitle
    Generates a title line. This is used for page titles.
- modules
  - account
    Manages the object class "account" for users and hosts.
  - accountContainer
    This class includes all modules and attributes of an account.
  - asteriskAccount
    Manages the Asterisk extension of user accounts.
  - asteriskExtension
    Manages Asterisk extensions.
  - asteriskVoicemail
    Manages the Asterisk extension of user accounts.
  - authorizedServiceObject
    Provides Authorized Service for accounts.
  - baseModule
    Parent class of all account modules.
  - ddns
    Manages DDNS entries.
  - dhcp_settings
    Manages DHCP entries.
  - eduPerson
    Manages the eduPerson extension for user accounts.
  - fixed_ip
    Manages DHCP host entries.
  - freeRadius
    Manages FreeRadius accounts.
  - generalInformation
    Shows general information like the creation time of an account.
  - hostObject
    Manages the hosts to which a user may login.
  - ieee802device
    Provides MAC addresses for hosts.
  - imapAccess
    Manages mailboxes on an IMAP server.
  - inetLocalMailRecipient
    Provides mail routing for users.
  - inetOrgPerson
    This module manages LDAP attributes of the object class inetOrgPerson (e.g. name and address).
  - kolabGroup
    Manages Kolab group accounts.
  - kolabUser
    Manages Kolab user accounts.
  - ldapPublicKey
    Manages SSH public keys.
  - nisMailAlias
    Provides NIS mail alias management.
  - nisnetgroup
    Manages entries based on the object class nisNetgroup.
  - passwordService
    This interface needs to be implemented by all account modules which manage passwords.
  - posixAccount
    Manages the object class "posixAccount" for users and hosts.
  - posixGroup
    Manages the object class "posixGroup" for groups.
  - puppetClient
    Manages Puppet configuration options.
  - quota
    Manages quotas for users and groups.
  - range
    Manages DHCP ranges for DHCP server.
  - samba3domain
    Represents a Samba 3 domain entry
  - sambaDomain
    Manages Samba 3 domain entries.
  - sambaGroupMapping
    Manages the object class "sambaGroupMapping" for groups.
  - sambaMungedDial
    Manages terminal server settings for Samba 3.
  - sambaSamAccount
    Manages the object class "sambaSamAccount" for users and hosts.
  - shadowAccount
    Manages the object class "shadowAccount" for users.
  - smbHash
    Calculates NT and LM hashes.
  - systemQuotas
    Manages user quotas with the object class systemQuotas.
  - windowsGroup
    Manages Windows AD (e.g. Samba 4) groups.
  - windowsHost
    Manages Windows AD (e.g. Samba 4) hosts.
  - windowsPosixGroup
    Manages Unix groups in Windows LDAP schema.
  - windowsUser
    Manages Windows AD (e.g. Samba 4) users.
- phpLDAPadmin
- profiles
- selfService
  - selfServiceProfile
    Includes all settings of a self service profile.
- tools
  - LAMSubTool
    Represents a subtool.
  - LAMTool
    Represents a tool.
  - toolFileUpload
    File upload
  - toolOUEditor
    OU editor
  - toolPDFEditor
    PDF editor
  - toolProfileEditor
    Profile editor
  - toolSchemaBrowser
    Schema browser
  - toolServerInformation
    Server information
  - toolTests
    Tests page
- types
  - asteriskExt
    The account type for Asterisk extensions.
  - baseType
    This is the parent class of all account types.
  - dhcp
    The account type for DHCP
  - group
    The account type for group accounts (e.g. Unix and Samba).
  - host
    The account type for host accounts (e.g. Samba).
  - mailAlias
    The account type for mail aliases.
  - netgroup
    The account type for NIS netgroups.
  - smbDomain
    The account type for Samba domains.
  - user
    The account type for user accounts (e.g. Unix, Samba and Kolab).