mirror of
https://github.com/flextype/flextype.git
synced 2025-08-12 08:04:05 +02:00
Flextype Admin Panel: code fixes according Scrutinizer Tests.
- Using exit here is not recommended.
This commit is contained in:
@@ -92,7 +92,7 @@ class EntriesManager
|
||||
}
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ class EntriesManager
|
||||
Notification::set('success', __('admin_message_entry_deleted'));
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/entries/?entry=' . Http::get('entry_current'));
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -121,7 +121,7 @@ class EntriesManager
|
||||
Notification::set('success', __('admin_message_entry_duplicated'));
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/entries/?entry=' . implode('/', array_slice(explode("/", Http::get('entry')), 0, -1)));
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -142,7 +142,7 @@ class EntriesManager
|
||||
}
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ class EntriesManager
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/entries?entry=' . implode('/', array_slice(explode("/", Http::get('entry')), 0, -1)));
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ class EntriesManager
|
||||
}
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ class EntriesManager
|
||||
Notification::set('success', __('admin_message_entry_changes_saved'));
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/entries/edit?entry=' . Http::post('entry_name') . '&source=true');
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ class EntriesManager
|
||||
Notification::set('success', __('admin_message_entry_file_deleted'));
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/entries/edit?entry=' . Http::get('entry') . '&media=true');
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -511,7 +511,7 @@ class EntriesManager
|
||||
}
|
||||
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ class FieldsetsManager
|
||||
}
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class FieldsetsManager
|
||||
Notification::set('success', __('admin_message_fieldset_deleted'));
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/fieldsets');
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -78,7 +78,7 @@ class FieldsetsManager
|
||||
}
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ class FieldsetsManager
|
||||
Notification::set('success', __('admin_message_fieldset_duplicated'));
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/fieldsets');
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -113,7 +113,7 @@ class FieldsetsManager
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/fieldsets/edit?fieldset=' . Http::post('name'));
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -39,7 +39,7 @@ class MenusManager
|
||||
}
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class MenusManager
|
||||
Notification::set('success', __('admin_message_menu_deleted'));
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/menus');
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -72,7 +72,7 @@ class MenusManager
|
||||
}
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ class MenusManager
|
||||
Notification::set('success', __('admin_message_menu_duplicated'));
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/menus');
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -107,7 +107,7 @@ class MenusManager
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/menus/edit?menu=' . Http::post('name'));
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -25,7 +25,7 @@ class PluginsManager
|
||||
Filesystem::write(PATH['plugins'] . '/' . Http::post('plugin') . '/' . 'settings.yaml', YamlParser::encode($plugin_settings));
|
||||
Cache::clear();
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ class SettingsManager
|
||||
Notification::set('success', __('admin_message_cache_files_deleted'));
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/settings');
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class SettingsManager
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/settings');
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -39,7 +39,7 @@ class SnippetsManager
|
||||
}
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class SnippetsManager
|
||||
Notification::set('success', __('admin_message_snippet_deleted'));
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/snippets');
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -72,7 +72,7 @@ class SnippetsManager
|
||||
}
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ class SnippetsManager
|
||||
Notification::set('success', __('admin_message_snippet_duplicated'));
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/snippets');
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -107,7 +107,7 @@ class SnippetsManager
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/snippets/edit?snippet=' . Http::post('name'));
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -38,7 +38,7 @@ class TemplatesManager
|
||||
}
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class TemplatesManager
|
||||
Notification::set('success', __('admin_message_template_deleted'));
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/templates');
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -74,7 +74,7 @@ class TemplatesManager
|
||||
}
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ class TemplatesManager
|
||||
Notification::set('success', __('admin_message_template_duplicated'));
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/templates');
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -113,7 +113,7 @@ class TemplatesManager
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/templates/edit?template=' . Http::post('name') . '&type=' . $type);
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -28,7 +28,7 @@ class UsersManager
|
||||
Session::destroy();
|
||||
Http::redirect(Http::getBaseUrl() . '/admin');
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ class UsersManager
|
||||
Http::redirect(Http::getBaseUrl() . '/admin/entries');
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ class UsersManager
|
||||
Notification::set('error', __('admin_message_wrong_username_password'));
|
||||
}
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
|
||||
throw new \RuntimeException("Request was denied because it contained an invalid security token. Please refresh the page and try again.");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user