- 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
This commit is contained in:
Paolo
2018-05-23 18:57:39 +02:00
parent 9f1ea4c882
commit e691dc8578
2 changed files with 12 additions and 19 deletions
@@ -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;
}
}
+9 -1
View File
@@ -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
}
}