Disallow saving data if app is locked
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
1ef4ea6381
commit
3612526632
1 changed files with 14 additions and 12 deletions
|
@ -1062,20 +1062,22 @@ class SettingsController extends Controller
|
||||||
*/
|
*/
|
||||||
public function postGoogleLoginSettings(Request $request)
|
public function postGoogleLoginSettings(Request $request)
|
||||||
{
|
{
|
||||||
if (!$setting = Setting::getSettings()) {
|
if (!config('app.lock_passwords')) {
|
||||||
return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error'));
|
$setting = Setting::getSettings();
|
||||||
|
|
||||||
|
$setting->google_login = $request->input('google_login', 0);
|
||||||
|
$setting->google_client_id = $request->input('google_client_id');
|
||||||
|
$setting->google_client_secret = $request->input('google_client_secret');
|
||||||
|
|
||||||
|
if ($setting->save()) {
|
||||||
|
return redirect()->route('settings.index')
|
||||||
|
->with('success', trans('admin/settings/message.update.success'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return redirect()->back()->withInput()->withErrors($setting->getErrors());
|
||||||
}
|
}
|
||||||
|
|
||||||
$setting->google_login = $request->input('google_login', 0);
|
return redirect()->back()->with('error', trans('general.feature_disabled'));
|
||||||
$setting->google_client_id = $request->input('google_client_id');
|
|
||||||
$setting->google_client_secret = $request->input('google_client_secret');
|
|
||||||
|
|
||||||
if ($setting->save()) {
|
|
||||||
return redirect()->route('settings.index')
|
|
||||||
->with('success', trans('admin/settings/message.update.success'));
|
|
||||||
}
|
|
||||||
|
|
||||||
return redirect()->back()->withInput()->withErrors($setting->getErrors());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue