From 724a2f02be965878a4a4c1baf4a4ed288cd17c0d Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 16 Feb 2025 13:45:22 +1100 Subject: [PATCH] Fix import, missing sprintf() and should use has() not contains() --- README.md | 2 +- app/Ldap/Entry.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 934fff74..6b3da59e 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ The update to v2 is progressing well - here is a list of work to do and done: - [X] Configure login by a specific attribute - [X] Logout LDAP server - [X] Export entries as an LDAP -- [ ] Import LDIF +- [X] Import LDIF - [X] Schema Browser - [ ] Is there something missing? diff --git a/app/Ldap/Entry.php b/app/Ldap/Entry.php index 06e3194a..2bc93762 100644 --- a/app/Ldap/Entry.php +++ b/app/Ldap/Entry.php @@ -146,8 +146,8 @@ class Entry extends Model { $key = $this->normalizeAttributeKey($key); - if (! config('server')->schema('attributetypes')->contains($key)) - throw new AttributeException('Schema doesnt have attribute [%s]',$key); + if (! config('server')->schema('attributetypes')->has($key)) + throw new AttributeException(sprintf('Schema doesnt have attribute [%s]',$key)); if ($x=$this->objects->get($key)) { $x->addValue($value);