Enabled form validation
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Classes\LDAP\Schema;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
@@ -271,6 +272,7 @@ final class AttributeType extends Base {
|
||||
case 'type': return $this->type;
|
||||
case 'usage': return $this->usage;
|
||||
case 'used_in_object_classes': return $this->used_in_object_classes;
|
||||
case 'validation': return Arr::get(config('ldap.validation'),$this->name_lc);
|
||||
|
||||
default: return parent::__get($key);
|
||||
}
|
||||
|
@@ -112,10 +112,10 @@ class HomeController extends Controller
|
||||
];
|
||||
});
|
||||
|
||||
if (Session::has('dn'))
|
||||
if (old('dn'))
|
||||
return view('dn')
|
||||
->with('bases',$bases)
|
||||
->with('o',config('server')->fetch($dn=Crypt::decryptString(Session::pull('dn'))))
|
||||
->with('o',config('server')->fetch($dn=Crypt::decryptString(old('dn'))))
|
||||
->with('dn',$dn);
|
||||
else
|
||||
return view('home')
|
||||
|
@@ -23,9 +23,12 @@ class EntryRequest extends FormRequest
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'dn'=>'string|min:3',
|
||||
'objectclass'=>'array|min:1',
|
||||
];
|
||||
return config('server')
|
||||
->schema('attributetypes')
|
||||
->intersectByKeys($this->request)
|
||||
->transform(function($item) { return $item->validation; })
|
||||
->filter()
|
||||
->flatMap(function($item) { return $item; })
|
||||
->toArray();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user