From a56b2d8002ef9a60432f85170ba60b208b753b7d Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 11 Mar 2025 21:02:11 +1100 Subject: [PATCH] Add some opendj internal attributes. Remove some unused variables in APIController --- app/Classes/LDAP/Attribute/Factory.php | 3 +++ app/Classes/LDAP/Attribute/Internal/Etag.php | 12 ++++++++++++ .../LDAP/Attribute/Internal/NumSubordinates.php | 12 ++++++++++++ .../LDAP/Attribute/Internal/PwdPolicySubentry.php | 12 ++++++++++++ app/Http/Controllers/APIController.php | 5 ++--- 5 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 app/Classes/LDAP/Attribute/Internal/Etag.php create mode 100644 app/Classes/LDAP/Attribute/Internal/NumSubordinates.php create mode 100644 app/Classes/LDAP/Attribute/Internal/PwdPolicySubentry.php diff --git a/app/Classes/LDAP/Attribute/Factory.php b/app/Classes/LDAP/Attribute/Factory.php index 08856a68..a086fb47 100644 --- a/app/Classes/LDAP/Attribute/Factory.php +++ b/app/Classes/LDAP/Attribute/Factory.php @@ -26,12 +26,15 @@ class Factory 'entrycsn' => Internal\CSN::class, 'entrydn' => Internal\DN::class, 'entryuuid' => Internal\UUID::class, + 'etag' => Internal\Etag::class, 'gidnumber' => GidNumber::class, 'hassubordinates' => Internal\HasSubordinates::class, 'jpegphoto' => Binary\JpegPhoto::class, 'modifytimestamp' => Internal\Timestamp::class, 'modifiersname' => Internal\DN::class, + 'numsubordinates' => Internal\NumSubordinates::class, 'objectclass' => ObjectClass::class, + 'pwdpolicysubentry' => Internal\PwdPolicySubentry::class, 'structuralobjectclass' => Internal\StructuralObjectClass::class, 'subschemasubentry' => Internal\SubschemaSubentry::class, 'supportedcontrol' => Schema\OID::class, diff --git a/app/Classes/LDAP/Attribute/Internal/Etag.php b/app/Classes/LDAP/Attribute/Internal/Etag.php new file mode 100644 index 00000000..e7ea60be --- /dev/null +++ b/app/Classes/LDAP/Attribute/Internal/Etag.php @@ -0,0 +1,12 @@ +query('depth',1); $dn = Crypt::decryptString($request->query('key')); // Sometimes our key has a command, so we'll ignore it if (str_starts_with($dn,'*') && ($x=strpos($dn,'|'))) $dn = substr($dn,$x+1); - Log::debug(sprintf('%s: Query [%s] - Levels [%d]',__METHOD__,$dn,$levels)); + Log::debug(sprintf('%s: Query [%s]',__METHOD__,$dn)); return (config('server')) ->children($dn) @@ -102,7 +101,7 @@ class APIController extends Controller * @param string $objectclass * @return array */ - public function schema_objectclass_attrs(Request $request,string $objectclass): array + public function schema_objectclass_attrs(string $objectclass): array { $oc = config('server')->schema('objectclasses',$objectclass);