{"id":21056020,"url":"https://github.com/xp-framework/ldap","last_synced_at":"2025-10-13T20:10:27.897Z","repository":{"id":11788072,"uuid":"14329942","full_name":"xp-framework/ldap","owner":"xp-framework","description":"LDAP protocol support for the XP Framework","archived":false,"fork":false,"pushed_at":"2022-11-02T14:30:17.000Z","size":3384,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-08T18:34:28.551Z","etag":null,"topics":["ldap","php","xp-framework"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xp-framework.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-12T11:08:29.000Z","updated_at":"2022-02-27T10:29:11.000Z","dependencies_parsed_at":"2022-09-23T02:01:05.769Z","dependency_job_id":null,"html_url":"https://github.com/xp-framework/ldap","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/xp-framework/ldap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fldap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fldap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fldap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fldap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xp-framework","download_url":"https://codeload.github.com/xp-framework/ldap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fldap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016934,"owners_count":26085905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ldap","php","xp-framework"],"created_at":"2024-11-19T16:48:20.736Z","updated_at":"2025-10-13T20:10:27.877Z","avatar_url":"https://github.com/xp-framework.png","language":"PHP","readme":"LDAP support for the XP Framework\n========================================================================\n\n[![Build status on GitHub](https://github.com/xp-framework/ldap/workflows/Tests/badge.svg)](https://github.com/xp-framework/ldap/actions)\n[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)\n[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)\n[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/xp-framework/ldap/version.png)](https://packagist.org/packages/xp-framework/ldap)\n\nThe peer.ldap package implements LDAP (Lighweight Directory Access Protocol) access.\n\nExample (LDAP search)\n---------------------\n\n```php\nuse peer\\ldap\\LDAPConnection;\nuse util\\cmd\\Console;\n\n$l= new LDAPConnection('ldap://ldap.example.com');\n$l-\u003econnect();\n\n$search= $l-\u003esearch(\n  'ou=People,dc=OpenLDAP,dc=Org', \n  '(objectClass=*)'\n);\n  \nConsole::writeLinef('===\u003e %d entries found', $search-\u003enumEntries());\nforeach ($search as $result) {\n  Console::writeLine('---\u003e ', $result-\u003etoString());\n}\n\n$l-\u003eclose();\n```\n\nExample (Modifying an entry)\n----------------------------\n\n```php\nuse peer\\ldap\\{LDAPConnection, LDAPEntry};\n\n$l= new LDAPConnection('ldap://uid=admin,o=roles,dc=planet-xp,dc=net:password@ldap.example.com');\n$l-\u003econnect();\n\nwith ($entry= $l-\u003eread(new LDAPEntry('uid=1549,o=people,dc=planet-xp,dc=net'))); {\n  $entry-\u003esetAttribute('firstname', 'Timm');\n\n  $l-\u003emodify($entry);\n}\n\n$l-\u003eclose();\n```\n\nExample (Adding an entry)\n-------------------------\n\n```php\nuse peer\\ldap\\{LDAPConnection, LDAPEntry};\n\n$l= new LDAPConnection('ldap://uid=admin,o=roles,dc=planet-xp,dc=net:password@ldap.example.com');\n$l-\u003econnect();\n\nwith ($entry= new LDAPEntry('uid=1549,o=people,dc=planet-xp,dc=net')); {\n  $entry-\u003esetAttribute('uid', 1549);\n  $entry-\u003esetAttribute('firstname', 'Timm');\n  $entry-\u003esetAttribute('lastname', 'Friebe');\n  $entry-\u003esetAttribute('objectClass', 'xpPerson');\n\n  $l-\u003eadd($entry);\n}\n\n$l-\u003eclose();\n```\n\nDynamically creating LDAP queries\n---------------------------------\nIf the LDAP queries need to be constructed dynamically the LDAPQuery\nclass provides a printf-style syntax to do so:\n\n```php\nuse peer\\ldap\\LDAPQuery;\n\n$res= $ldap-\u003esearchBy(new LDAPQuery(\n  'o=people,dc=planet-xp,dc=net',\n  '(\u0026(objectClass=%c)(|(username=%s)(uid=%d)))',\n  'xpPerson',\n  'friebe'\n  1549\n));\n```\n\nWhen using the \"%s\" token, the value passed is escaped according to \nrules in LDAP query syntax. The %c token copies as-is, and %d handles\nthe argument as numeric value.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-framework%2Fldap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxp-framework%2Fldap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-framework%2Fldap/lists"}