diff --git a/app/Classes/LDAP/Attribute.php b/app/Classes/LDAP/Attribute.php index 810cea85..82c22ef9 100644 --- a/app/Classes/LDAP/Attribute.php +++ b/app/Classes/LDAP/Attribute.php @@ -253,10 +253,9 @@ class Attribute implements \Countable, \ArrayAccess */ public function isDirty(): bool { - return (($a=$this->values_old->dot())->keys()->count() !== ($b=$this->values->dot())->keys()->count()) - || ($a->values()->count() !== $b->values()->count()) - || ($a->keys()->diff($b->keys())->count() !== 0) - || ($a->values()->diff($b->values())->count() !== 0); + return (($a=$this->values_old->dot()->filter())->keys()->count() !== ($b=$this->values->dot()->filter())->keys()->count()) + || ($a->count() !== $b->count()) + || ($a->diff($b)->count() !== 0); } /** diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index a5da0265..d9b0ae16 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -349,7 +349,7 @@ class HomeController extends Controller return Redirect::to('/') ->withInput() - ->with('updated',collect($dirty)->map(fn($key,$item)=>$o->getObject($item))); + ->with('updated',collect($dirty)->map(fn($item,$key)=>$o->getObject(collect(explode(';',$key))->first()))); } /** @@ -376,7 +376,7 @@ class HomeController extends Controller // If we are rendering a DN, rebuild our object $o = config('server')->fetch($key['dn']); - foreach (collect(old())->except(['key','step','_token','userpassword_hash']) as $attr => $value) + foreach (collect(old())->except(['key','dn','step','_token','userpassword_hash']) as $attr => $value) $o->{$attr} = $value; return match ($key['cmd']) { diff --git a/resources/views/components/updated.blade.php b/resources/views/components/updated.blade.php index a75784c3..86c770fa 100644 --- a/resources/views/components/updated.blade.php +++ b/resources/views/components/updated.blade.php @@ -5,7 +5,7 @@
{{ __('Entry updated') }}