0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-21 15:36:58 +00:00

Started widening of activity logging

In progress, Need to implement much of the logging in controllers.
Also cleaned up base controller along the way.
This commit is contained in:
Dan Brown 2020-11-18 23:38:44 +00:00
parent 712ccd23c4
commit 3f7180fa99
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
11 changed files with 115 additions and 60 deletions
app/Http/Controllers

View file

@ -1,5 +1,6 @@
<?php namespace BookStack\Http\Controllers;
use BookStack\Actions\ActivityType;
use BookStack\Auth\User;
use BookStack\Uploads\ImageRepo;
use Illuminate\Http\Request;
@ -47,10 +48,10 @@ class SettingController extends Controller
// Cycles through posted settings and update them
foreach ($request->all() as $name => $value) {
$key = str_replace('setting-', '', trim($name));
if (strpos($name, 'setting-') !== 0) {
continue;
}
$key = str_replace('setting-', '', trim($name));
setting()->put($key, $value);
}
@ -68,8 +69,10 @@ class SettingController extends Controller
setting()->remove('app-logo');
}
$section = $request->get('section', '');
$this->logActivity(ActivityType::SETTINGS_UPDATE, $section);
$this->showSuccessNotification(trans('settings.settings_save_success'));
$redirectLocation = '/settings#' . $request->get('section', '');
$redirectLocation = '/settings#' . $section;
return redirect(rtrim($redirectLocation, '#'));
}
}