From e691dc857899af0c0aac45ba78c31305189c768d Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 23 May 2018 18:57:39 +0200 Subject: [PATCH] - Removed _setControllerId method from controller InfoCenter - InfoCenter controller now uses setControllerId and getControllerId from FHC_Controller - Fixed URL query string character in method FHC_Controller->setControllerId --- .../system/infocenter/InfoCenter.php | 21 +++---------------- application/core/FHC_Controller.php | 10 ++++++++- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 35b4d2879..7fab61736 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -95,7 +95,9 @@ class InfoCenter extends FHC_Controller if(!$this->permissionlib->isBerechtigt('basis/person')) show_error('You have no Permission! You need Infocenter Role'); - $this->_setControllerId(); // sets the controller id + $this->setControllerId(); // sets the controller id + + $this->fhc_controller_id = $this->getControllerId(); $this->setNavigationMenuArray(); // sets property navigationMenuArray } @@ -1090,21 +1092,4 @@ class InfoCenter extends FHC_Controller $this->loglib->logError('Studiengang has no mail for sending Freigabe mail'); } } - - /** - * Sets the unique id for the called controller - */ - private function _setControllerId() - { - $fhc_controller_id = $this->input->get('fhc_controller_id'); - - if (!isset($fhc_controller_id) || empty($fhc_controller_id)) - { - $fhc_controller_id = uniqid(); - header('Location: '.$_SERVER['REQUEST_URI'].'?fhc_controller_id='.$fhc_controller_id); - exit; - } - - $this->fhc_controller_id = $fhc_controller_id; - } } diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index 815c03da2..fc200d935 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -46,7 +46,15 @@ class FHC_Controller extends CI_Controller { $this->_controllerId = uniqid(); // generate a unique id // Redirect to the same URL, but giving FHC_CONTROLLER_ID as HTTP GET parameter - header(sprintf('Location: %s?%s=%s', $_SERVER['REQUEST_URI'], self::FHC_CONTROLLER_ID, $this->_controllerId)); + header( + sprintf( + 'Location: %s%s%s=%s', + $_SERVER['REQUEST_URI'], + strpos($_SERVER['REQUEST_URI'], '?') === false ? '?' : '&', // place the corret character to divide parameters + self::FHC_CONTROLLER_ID, + $this->_controllerId + ) + ); exit; // terminate immediately the execution of this controller } }