diff options
author | msquare <msquare@notrademark.de> | 2016-09-29 09:43:08 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2016-09-29 09:43:08 +0200 |
commit | bd9003f5d54bbf733fafc3359349127e18a8a1a1 (patch) | |
tree | 1bc08a445da5a527f245dc0d6a4cc442ff82c27a /includes/controller/event_config_controller.php | |
parent | 6685beb39784f63751b7cae6d211a5808c6e47a3 (diff) |
prohibit inline control structures on controllers
Diffstat (limited to 'includes/controller/event_config_controller.php')
-rw-r--r-- | includes/controller/event_config_controller.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/includes/controller/event_config_controller.php b/includes/controller/event_config_controller.php index 29a5b979..dc789ca6 100644 --- a/includes/controller/event_config_controller.php +++ b/includes/controller/event_config_controller.php @@ -7,8 +7,9 @@ function event_config_title() { function event_config_edit_controller() { global $privileges; - if (! in_array('admin_event_config', $privileges)) + if (! in_array('admin_event_config', $privileges)) { redirect('?'); + } $event_name = null; $event_welcome_msg = null; @@ -18,8 +19,9 @@ function event_config_edit_controller() { $teardown_end_date = null; $event_config = EventConfig(); - if ($event_config === false) + if ($event_config === false) { engelsystem_error('Unable to load event config.'); + } if ($event_config != null) { $event_name = $event_config['event_name']; $buildup_start_date = $event_config['buildup_start_date']; @@ -32,15 +34,19 @@ function event_config_edit_controller() { if (isset($_REQUEST['submit'])) { $ok = true; - if (isset($_REQUEST['event_name'])) + if (isset($_REQUEST['event_name'])) { $event_name = strip_request_item('event_name'); - if ($event_name == '') + } + if ($event_name == '') { $event_name = null; + } - if (isset($_REQUEST['event_welcome_msg'])) + if (isset($_REQUEST['event_welcome_msg'])) { $event_welcome_msg = strip_request_item_nl('event_welcome_msg'); - if ($event_welcome_msg == '') + } + if ($event_welcome_msg == '') { $event_welcome_msg = null; + } $result = check_request_date('buildup_start_date', _("Please enter buildup start date."), true); $buildup_start_date = $result->getValue(); @@ -81,8 +87,9 @@ function event_config_edit_controller() { if ($ok) { $result = EventConfig_update($event_name, $buildup_start_date, $event_start_date, $event_end_date, $teardown_end_date, $event_welcome_msg); - if ($result === false) + if ($result === false) { engelsystem_error("Unable to update event config."); + } engelsystem_log("Changed event config: $event_name, $event_welcome_msg, " . date("Y-m-d", $buildup_start_date) . ", " . date("Y-m-d", $event_start_date) . ", " . date("Y-m-d", $event_end_date) . ", " . date("Y-m-d", $teardown_end_date)); success(_("Settings saved.")); |