Enabled form validation
This commit is contained in:
@@ -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