mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 21:54:14 -08:00
Add validation for pwd_secure_complexity
This commit is contained in:
parent
67b5e9093e
commit
5815607924
|
@ -20,6 +20,7 @@ use DB;
|
||||||
use enshrined\svgSanitize\Sanitizer;
|
use enshrined\svgSanitize\Sanitizer;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Illuminate\Validation\Rule;
|
||||||
use Image;
|
use Image;
|
||||||
use Input;
|
use Input;
|
||||||
use Redirect;
|
use Redirect;
|
||||||
|
@ -499,6 +500,19 @@ class SettingsController extends Controller
|
||||||
*/
|
*/
|
||||||
public function postSecurity(Request $request)
|
public function postSecurity(Request $request)
|
||||||
{
|
{
|
||||||
|
$this->validate($request, [
|
||||||
|
'pwd_secure_complexity' => 'array',
|
||||||
|
'pwd_secure_complexity.*' => [
|
||||||
|
Rule::in([
|
||||||
|
'disallow_same_pwd_as_user_fields',
|
||||||
|
'letters',
|
||||||
|
'numbers',
|
||||||
|
'symbols',
|
||||||
|
'case_diff',
|
||||||
|
])
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
|
||||||
if (is_null($setting = Setting::getSettings())) {
|
if (is_null($setting = Setting::getSettings())) {
|
||||||
return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error'));
|
return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue