X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/dec0cbb1b25d139c504923a15b4ce884562c7404..refs/pull/106/head:/app/Http/Controllers/SettingController.php diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index 5193a9d3b..1791ccfac 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -1,43 +1,40 @@ -checkPermission('settings-update'); + $this->checkPermission('settings-manage'); + $this->setPageTitle('Settings'); return view('settings/index'); } - - /** * Update the specified settings in storage. - * - * @param Request $request + * @param Request $request * @return Response */ public function update(Request $request) { - $this->checkPermission('settings-update'); + $this->preventAccessForDemoUsers(); + $this->checkPermission('settings-manage'); + // Cycles through posted settings and update them - foreach($request->all() as $name => $value) { - if(strpos($name, 'setting-') !== 0) continue; + foreach ($request->all() as $name => $value) { + if (strpos($name, 'setting-') !== 0) continue; $key = str_replace('setting-', '', trim($name)); Setting::put($key, $value); } + session()->flash('success', 'Settings Saved'); return redirect('/settings'); }