325 lines
12 KiB
PHP
325 lines
12 KiB
PHP
<?php
|
|
namespace nur\ldap;
|
|
|
|
use nur\ldap\syntaxes\BinarySyntax;
|
|
use nur\ldap\syntaxes\BooleanSyntax;
|
|
use nur\ldap\syntaxes\DateSyntax;
|
|
use nur\ldap\syntaxes\IntegerSyntax;
|
|
use nur\ldap\syntaxes\MailSyntax;
|
|
use nur\ldap\syntaxes\PostalAddressSyntax;
|
|
use nur\ldap\syntaxes\PrintableSyntax;
|
|
use nur\ldap\syntaxes\StringSyntax;
|
|
use nur\ldap\syntaxes\TelephoneSyntax;
|
|
|
|
class consts {
|
|
/**
|
|
* @var array[] définitions connues des syntaxes, au cas où le serveur ne les
|
|
* retourne pas
|
|
*/
|
|
const KNOWN_SLAPD_SYNTAXES = [
|
|
'1.3.6.1.4.1.1466.115.121.1.4' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.4',
|
|
'desc' => 'Audio',
|
|
'x_not_human_readable' => true,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.5' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.5',
|
|
'desc' => 'Binary',
|
|
'x_not_human_readable' => true,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.6' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.6',
|
|
'desc' => 'Bit String',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.7' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.7',
|
|
'desc' => 'Boolean',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.8' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.8',
|
|
'desc' => 'Certificate',
|
|
'x_not_human_readable' => true,
|
|
'x_binary_transfer_required' => true,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.9' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.9',
|
|
'desc' => 'Certificate List',
|
|
'x_not_human_readable' => true,
|
|
'x_binary_transfer_required' => true,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.10' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.10',
|
|
'desc' => 'Certificate Pair',
|
|
'x_not_human_readable' => true,
|
|
'x_binary_transfer_required' => true,
|
|
],
|
|
'1.3.6.1.4.1.4203.666.11.10.2.1' => [
|
|
'oid' => '1.3.6.1.4.1.4203.666.11.10.2.1',
|
|
'desc' => 'X.509 AttributeCertificate',
|
|
'x_not_human_readable' => true,
|
|
'x_binary_transfer_required' => true,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.12' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.12',
|
|
'desc' => 'Distinguished Name',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.2.36.79672281.1.5.0' => [
|
|
'oid' => '1.2.36.79672281.1.5.0',
|
|
'desc' => 'RDN',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.14' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.14',
|
|
'desc' => 'Delivery Method',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.15' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.15',
|
|
'desc' => 'Directory String',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.22' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.22',
|
|
'desc' => 'Facsimile Telephone Number',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.23' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.23',
|
|
'desc' => 'Fax image',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.24' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.24',
|
|
'desc' => 'Generalized Time',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.25' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.25',
|
|
'desc' => 'Guide',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.26' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.26',
|
|
'desc' => 'IA5 String',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.27' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.27',
|
|
'desc' => 'Integer',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.28' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.28',
|
|
'desc' => 'JPEG',
|
|
'x_not_human_readable' => true,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.34' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.34',
|
|
'desc' => 'Name And Optional UID',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.36' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.36',
|
|
'desc' => 'Numeric String',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.38' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.38',
|
|
'desc' => 'OID',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.39' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.39',
|
|
'desc' => 'Other Mailbox',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.40' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.40',
|
|
'desc' => 'Octet String',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.41' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.41',
|
|
'desc' => 'Postal Address',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.44' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.44',
|
|
'desc' => 'Printable String',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.11' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.11',
|
|
'desc' => 'Country String',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.45' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.45',
|
|
'desc' => 'SubtreeSpecification',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.49' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.49',
|
|
'desc' => 'Supported Algorithm',
|
|
'x_not_human_readable' => true,
|
|
'x_binary_transfer_required' => true,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.50' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.50',
|
|
'desc' => 'Telephone Number',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.51' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.51',
|
|
'desc' => 'Teletex Terminal Identifier',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.52' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.52',
|
|
'desc' => 'Telex Number',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.53' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.53',
|
|
'desc' => 'UTC Time',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.4.1.1466.115.121.1.54' => [
|
|
'oid' => '1.3.6.1.4.1.1466.115.121.1.54',
|
|
'desc' => 'LDAP Syntax Description',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.1.1.0.0' => [
|
|
'oid' => '1.3.6.1.1.1.0.0',
|
|
'desc' => 'RFC2307 NIS Netgroup Triple',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.1.1.0.1' => [
|
|
'oid' => '1.3.6.1.1.1.0.1',
|
|
'desc' => 'RFC2307 Boot Parameter',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
'1.3.6.1.1.16.1' => [
|
|
'oid' => '1.3.6.1.1.16.1',
|
|
'desc' => 'UUID',
|
|
'x_not_human_readable' => false,
|
|
'x_binary_transfer_required' => false,
|
|
],
|
|
];
|
|
|
|
const KNOWN_SYNTAX_CLASSES = [
|
|
'1.3.6.1.4.1.1466.115.121.1.4' => BinarySyntax::class, // audio
|
|
'1.3.6.1.4.1.1466.115.121.1.5' => BinarySyntax::class, // binary
|
|
'1.3.6.1.4.1.1466.115.121.1.6' => BinarySyntax::class, // bit string
|
|
'1.3.6.1.4.1.1466.115.121.1.7' => BooleanSyntax::class, // boolean
|
|
'1.3.6.1.4.1.1466.115.121.1.8' => BinarySyntax::class, // certificate
|
|
'1.3.6.1.4.1.1466.115.121.1.9' => BinarySyntax::class, // certificate list
|
|
'1.3.6.1.4.1.1466.115.121.1.10' => BinarySyntax::class, // certificate pair
|
|
'1.3.6.1.4.1.4203.666.11.10.2.1' => BinarySyntax::class, // X.509 AttributeCertificate
|
|
'1.3.6.1.4.1.1466.115.121.1.12' => StringSyntax::class, // DN
|
|
'1.2.36.79672281.1.5.0' => StringSyntax::class, // RDN
|
|
'1.3.6.1.4.1.1466.115.121.1.14' => StringSyntax::class, // delivery method
|
|
'1.3.6.1.4.1.1466.115.121.1.15' => StringSyntax::class, // directory string
|
|
'1.3.6.1.4.1.1466.115.121.1.22' => TelephoneSyntax::class, // fax number
|
|
'1.3.6.1.4.1.1466.115.121.1.24' => DateSyntax::class, // generalized time
|
|
'1.3.6.1.4.1.1466.115.121.1.26' => StringSyntax::class, // IA5 string
|
|
'1.3.6.1.4.1.1466.115.121.1.27' => IntegerSyntax::class, // integer
|
|
'1.3.6.1.4.1.1466.115.121.1.28' => BinarySyntax::class, // jpeg
|
|
'1.3.6.1.4.1.1466.115.121.1.34' => StringSyntax::class, // name and (opt.) oid
|
|
'1.3.6.1.4.1.1466.115.121.1.36' => IntegerSyntax::class, // numeric string
|
|
'1.3.6.1.4.1.1466.115.121.1.38' => StringSyntax::class, // oid
|
|
'1.3.6.1.4.1.1466.115.121.1.39' => MailSyntax::class, // other mailbox
|
|
'1.3.6.1.4.1.1466.115.121.1.40' => StringSyntax::class, // octet string
|
|
'1.3.6.1.4.1.1466.115.121.1.41' => PostalAddressSyntax::class, // postal address
|
|
'1.3.6.1.4.1.1466.115.121.1.44' => PrintableSyntax::class, // printable string
|
|
'1.3.6.1.4.1.1466.115.121.1.11' => StringSyntax::class, // country string
|
|
'1.3.6.1.4.1.1466.115.121.1.45' => StringSyntax::class, // subtree spec
|
|
'1.3.6.1.4.1.1466.115.121.1.49' => BinarySyntax::class, // supported algorithm
|
|
'1.3.6.1.4.1.1466.115.121.1.50' => TelephoneSyntax::class, // telephone number
|
|
'1.3.6.1.4.1.1466.115.121.1.52' => TelephoneSyntax::class, // telex number
|
|
'1.3.6.1.1.1.0.0' => StringSyntax::class, // RFC2307 NIS Netgroup Triple
|
|
'1.3.6.1.1.1.0.1' => StringSyntax::class, // RFC2307 Boot Parameter
|
|
'1.3.6.1.1.16.1' => StringSyntax::class, // uuid
|
|
];
|
|
|
|
const LDAP_CONTROL_CONSTANTS = [
|
|
# pas toutes ne sont définies en fonction de la version de PHP
|
|
"LDAP_CONTROL_MANAGEDSAIT",
|
|
"LDAP_CONTROL_PROXY_AUTHZ",
|
|
"LDAP_CONTROL_SUBENTRIES",
|
|
"LDAP_CONTROL_VALUESRETURNFILTER",
|
|
"LDAP_CONTROL_ASSERT",
|
|
"LDAP_CONTROL_PRE_READ",
|
|
"LDAP_CONTROL_POST_READ",
|
|
"LDAP_CONTROL_SORTREQUEST",
|
|
"LDAP_CONTROL_SORTRESPONSE",
|
|
"LDAP_CONTROL_PAGEDRESULTS",
|
|
"LDAP_CONTROL_SYNC",
|
|
"LDAP_CONTROL_SYNC_STATE",
|
|
"LDAP_CONTROL_SYNC_DONE",
|
|
"LDAP_CONTROL_DONTUSECOPY",
|
|
"LDAP_CONTROL_PASSWORDPOLICYREQUEST",
|
|
"LDAP_CONTROL_PASSWORDPOLICYRESPONSE",
|
|
"LDAP_CONTROL_X_INCREMENTAL_VALUES",
|
|
"LDAP_CONTROL_X_DOMAIN_SCOPE",
|
|
"LDAP_CONTROL_X_PERMISSIVE_MODIFY",
|
|
"LDAP_CONTROL_X_SEARCH_OPTIONS",
|
|
"LDAP_CONTROL_X_TREE_DELETE",
|
|
"LDAP_CONTROL_X_EXTENDED_DN",
|
|
"LDAP_CONTROL_VLVREQUEST",
|
|
"LDAP_CONTROL_VLVRESPONSE",
|
|
"LDAP_EXOP_MODIFY_PASSWD",
|
|
"LDAP_EXOP_REFRESH",
|
|
"LDAP_EXOP_START_TLS",
|
|
"LDAP_EXOP_TURN",
|
|
"LDAP_EXOP_WHO_AM_I",
|
|
"LDAP_CONTROL_AUTHZID_REQUEST",
|
|
"LDAP_CONTROL_AUTHZID_RESPONSE",
|
|
];
|
|
|
|
const ROOT_DSE_LITERALS = [
|
|
# Constantes non définies de façon normalisée
|
|
["1.3.6.1.1.8", "/*Cancel Extended Request*/ \"1.3.6.1.1.8\""],
|
|
["1.3.6.1.1.14", "/*Modify-Increment*/ \"1.3.6.1.1.14\""],
|
|
["1.3.6.1.4.1.4203.1.5.1", "/*All Op Attrs*/ \"1.3.6.1.4.1.4203.1.5.1\""],
|
|
["1.3.6.1.4.1.4203.1.5.2", "/*OC AD Lists*/ \"1.3.6.1.4.1.4203.1.5.2\""],
|
|
["1.3.6.1.4.1.4203.1.5.3", "/*LDAP Protocol Mechanism*/ \"1.3.6.1.4.1.4203.1.5.3\""],
|
|
["1.3.6.1.4.1.4203.1.5.4", "/*draft-zeilenga-ldap-rfc2596*/ \"1.3.6.1.4.1.4203.1.5.4\""],
|
|
["1.3.6.1.4.1.4203.1.5.5", "/*draft-zeilenga-ldap-rfc2596*/ \"1.3.6.1.4.1.4203.1.5.5\""],
|
|
];
|
|
}
|