From d90bc3288710b83e0509e85b0bfe9a64f2b035fb Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 17 Jul 2025 21:28:40 +0800 Subject: [PATCH] Fix schema viewer, showing objectClass name in used_in and not oid --- app/Classes/LDAP/Attribute.php | 4 ++-- app/Classes/LDAP/Server.php | 4 ++-- resources/views/fragment/schema/attributetypes.blade.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Classes/LDAP/Attribute.php b/app/Classes/LDAP/Attribute.php index f0403bb4..45882714 100644 --- a/app/Classes/LDAP/Attribute.php +++ b/app/Classes/LDAP/Attribute.php @@ -64,8 +64,8 @@ class Attribute implements \Countable, \ArrayAccess $soc = config('server')->schema('objectclasses',$objectclass); if ($soc) { - $this->oc->push($soc->oid); - $this->oc = $this->oc->merge($soc->getParents()->pluck('oid')); + $this->oc->push($soc->name); + $this->oc = $this->oc->merge($soc->getParents()->pluck('name')); } } } diff --git a/app/Classes/LDAP/Server.php b/app/Classes/LDAP/Server.php index 9854178a..82399d19 100644 --- a/app/Classes/LDAP/Server.php +++ b/app/Classes/LDAP/Server.php @@ -463,11 +463,11 @@ final class Server foreach ($o->attributes as $attribute) { if (($attrid = $this->schema('attributetypes')->search(fn($item)=>$item->oid === $attribute->oid)) !== FALSE) { // Add Used In. - $this->attributetypes[$attrid]->addUsedInObjectClass($o->oid,$o->isStructural()); + $this->attributetypes[$attrid]->addUsedInObjectClass($o->name,$o->isStructural()); // Add Required By. if ($attribute->is_must) - $this->attributetypes[$attrid]->addRequiredByObjectClass($o->oid,$o->isStructural()); + $this->attributetypes[$attrid]->addRequiredByObjectClass($o->name,$o->isStructural()); } } } diff --git a/resources/views/fragment/schema/attributetypes.blade.php b/resources/views/fragment/schema/attributetypes.blade.php index 891b8162..e0beac02 100644 --- a/resources/views/fragment/schema/attributetypes.blade.php +++ b/resources/views/fragment/schema/attributetypes.blade.php @@ -88,11 +88,11 @@ @lang('Used by ObjectClasses') @if($o->used_in_object_classes->count()) - @foreach($o->used_in_object_classes as $class => $structural) + @foreach($o->used_in_object_classes as $name => $structural) @if($structural) @endif - {{ $class }} + {{ $name }} @if($structural) @endif