Minor schema cosmetic code fixes, more Attribute implementation from old pla, start of LDAP DN view/edit

This commit is contained in:
2023-03-02 09:54:30 +11:00
parent 491f04cd5d
commit 64d1a09db4
15 changed files with 234 additions and 99 deletions

View File

@@ -5,7 +5,7 @@ namespace App\Classes\LDAP\Attribute;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Log;
use App\Classes\LDAP\{Attribute};
use App\Classes\LDAP\Attribute;
/**
* This factory is used to return LDAP attributes as an object
@@ -20,11 +20,13 @@ class Factory
* Map of attributes to appropriate class
*/
public const map = [
'entryuuid' => Internal\EntryUUID::class,
'jpegphoto' => Binary\JpegPhoto::class,
'supportedcontrol' => OID::class,
'supportedextension' => OID::class,
'supportedfeatures' => OID::class,
'supportedsaslmechanisms' => Mechanisms::class,
'objectclass' => ObjectClass::class,
'supportedcontrol' => Schema\OID::class,
'supportedextension' => Schema\OID::class,
'supportedfeatures' => Schema\OID::class,
'supportedsaslmechanisms' => Schema\Mechanisms::class,
];
/**
@@ -36,7 +38,7 @@ class Factory
*/
public static function create(string $attribute,array $values): Attribute
{
$class = Arr::get(self::map,strtolower($attribute),Attribute::class);
$class = Arr::get(self::map,$attribute,Attribute::class);
Log::debug(sprintf('%s:Creating LDAP Attribute [%s] as [%s]',static::LOGKEY,$attribute,$class));
return new $class($attribute,$values);