summaryrefslogtreecommitdiff
path: root/includes/controller/angeltypes_controller.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-07-18 21:38:53 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2017-07-19 11:44:16 +0200
commit3a1e4602492cec1c8f3d2aabab2c866022f43bf1 (patch)
treec367c1ce15f957a1e9a0879b875e8d635883280e /includes/controller/angeltypes_controller.php
parent04217834fa4e6f94fec0836a80ea5526b8ebc9bc (diff)
Changed $_GET, $_POST and $_REQUEST to use the Request object
Diffstat (limited to 'includes/controller/angeltypes_controller.php')
-rw-r--r--includes/controller/angeltypes_controller.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/includes/controller/angeltypes_controller.php b/includes/controller/angeltypes_controller.php
index daa754eb..346a4d73 100644
--- a/includes/controller/angeltypes_controller.php
+++ b/includes/controller/angeltypes_controller.php
@@ -81,7 +81,7 @@ function angeltype_delete_controller()
$angeltype = load_angeltype();
- if (isset($_REQUEST['confirmed'])) {
+ if (request()->has('confirmed')) {
AngelType_delete($angeltype);
success(sprintf(_('Angeltype %s deleted.'), AngelType_name_render($angeltype)));
redirect(page_link_to('angeltypes'));
@@ -104,8 +104,9 @@ function angeltype_edit_controller()
// In supporter mode only allow to modify description
$supporter_mode = !in_array('admin_angel_types', $privileges);
+ $request = request();
- if (isset($_REQUEST['angeltype_id'])) {
+ if ($request->has('angeltype_id')) {
// Edit existing angeltype
$angeltype = load_angeltype();
@@ -121,12 +122,12 @@ function angeltype_edit_controller()
$angeltype = AngelType_new();
}
- if (isset($_REQUEST['submit'])) {
+ if ($request->has('submit')) {
$valid = true;
if (!$supporter_mode) {
- if (isset($_REQUEST['name'])) {
- $result = AngelType_validate_name($_REQUEST['name'], $angeltype);
+ if ($request->has('name')) {
+ $result = AngelType_validate_name($request->get('name'), $angeltype);
$angeltype['name'] = $result->getValue();
if (!$result->isValid()) {
$valid = false;
@@ -134,10 +135,10 @@ function angeltype_edit_controller()
}
}
- $angeltype['restricted'] = isset($_REQUEST['restricted']);
- $angeltype['no_self_signup'] = isset($_REQUEST['no_self_signup']);
+ $angeltype['restricted'] = $request->has('restricted');
+ $angeltype['no_self_signup'] = $request->has('no_self_signup');
- $angeltype['requires_driver_license'] = isset($_REQUEST['requires_driver_license']);
+ $angeltype['requires_driver_license'] = $request->has('requires_driver_license');
}
$angeltype['description'] = strip_request_item_nl('description', $angeltype['description']);
@@ -262,11 +263,12 @@ function angeltypes_list_controller()
*/
function load_angeltype()
{
- if (!isset($_REQUEST['angeltype_id'])) {
+ $request = request();
+ if (!$request->has('angeltype_id')) {
redirect(page_link_to('angeltypes'));
}
- $angeltype = AngelType($_REQUEST['angeltype_id']);
+ $angeltype = AngelType($request->input('angeltype_id'));
if ($angeltype == null) {
error(_('Angeltype doesn\'t exist . '));
redirect(page_link_to('angeltypes'));