1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-11 23:54:06 +02:00

Admin Panel: Settings Manager - code fixes and refactoring according to Scrutinizer Tests.

This commit is contained in:
Awilum
2019-02-02 14:33:40 +03:00
parent 30a2c96d14
commit cce0f3de1f

View File

@@ -3,7 +3,6 @@
namespace Flextype;
use Flextype\Component\Arr\Arr;
use Flextype\Component\I18n\I18n;
use Flextype\Component\Http\Http;
use Flextype\Component\Filesystem\Filesystem;
use Flextype\Component\Registry\Registry;
@@ -18,7 +17,7 @@ class SettingsManager
Registry::set('sidebar_menu_item', 'settings');
// Clear cache
if (Http::get('clear_cache')) {
if (Http::get('clear_cache') !== null && Http::get('clear_cache') == '1' && Http::get('token') !== null) {
if (Token::check((Http::get('token')))) {
Cache::clear();
Notification::set('success', __('admin_message_cache_files_deleted'));
@@ -28,9 +27,7 @@ class SettingsManager
}
}
$action = Http::post('action');
if (isset($action) && $action == 'save-form') {
if (Http::post('action') !== null && Http::post('action') == 'save-form' && Http::post('token') !== null) {
if (Token::check((Http::post('token')))) {
$settings = $_POST;