2021-01-06 00:57:27 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use App\Facades\Options;
|
|
|
|
use App\Http\Requests\SaveSecuritySettings;
|
2021-07-25 21:54:15 +00:00
|
|
|
use App\Services\SecuritySettingsService;
|
2021-01-06 00:57:27 +00:00
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
|
|
use function PHPSTORM_META\map;
|
|
|
|
|
|
|
|
class SecuritySettingsController extends Controller
|
|
|
|
{
|
2021-07-25 21:54:15 +00:00
|
|
|
private $securityService;
|
|
|
|
|
|
|
|
public function __construct(SecuritySettingsService $securityService) {
|
|
|
|
$this->securityService = $securityService;
|
|
|
|
}
|
|
|
|
|
2021-01-06 00:57:27 +00:00
|
|
|
public function save(SaveSecuritySettings $request)
|
|
|
|
{
|
2021-07-25 21:54:15 +00:00
|
|
|
$this->securityService->save($request->secPolicy, [
|
|
|
|
'graceperiod' => $request->graceperiod,
|
|
|
|
'pwExpiry' => $request->pwExpiry,
|
|
|
|
'enforce2fa' => $request->enforce2fa,
|
|
|
|
'requirePMC' => $request->requirePMC
|
|
|
|
]);
|
|
|
|
|
|
|
|
return redirect()
|
|
|
|
->back()
|
|
|
|
->with('success', __('Settings saved.'));
|
2021-01-06 00:57:27 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|