X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/80865b30a5d6a82e86d21e272ae58977d4430a64..refs/pull/236/head:/app/Http/Controllers/SettingController.php diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index c43e6e399..65135eda3 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -1,32 +1,30 @@ -checkPermission('settings-manage'); $this->setPageTitle('Settings'); - return view('settings/index'); - } + // Get application version + $version = trim(file_get_contents(base_path('version'))); + + return view('settings/index', ['version' => $version]); + } /** * Update the specified settings in storage. - * - * @param Request $request + * @param Request $request * @return Response */ public function update(Request $request) @@ -35,8 +33,8 @@ class SettingController extends Controller $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); }