mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
Messages: Bug-Report von STP: Berechtigung
Now the controller Redirect/redirectByToken doesn't use anymore the OrganisationseinheitLib, therefore authentication is not required anymore
This commit is contained in:
@@ -31,9 +31,6 @@ class Redirect extends FHC_Controller
|
||||
|
||||
// Loads model MessageTokenModel
|
||||
$this->load->model('system/MessageToken_model', 'MessageTokenModel');
|
||||
|
||||
// Loads library OrganisationseinheitLib
|
||||
$this->load->library('OrganisationseinheitLib');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,10 +52,23 @@ class Redirect extends FHC_Controller
|
||||
|
||||
if ($oe_kurzbz != null && $oe_kurzbz != '')
|
||||
{
|
||||
$rootOE = $this->organisationseinheitlib->getRoot($oe_kurzbz);
|
||||
if ($rootOE->error)
|
||||
$organisationRoot = null;
|
||||
$getOERoot = $this->MessageTokenModel->getOERoot($oe_kurzbz);
|
||||
if ($getOERoot) // If no errors occurred
|
||||
{
|
||||
show_error($rootOE->retval);
|
||||
// If data are present
|
||||
if (is_array($getOERoot->result()) && count($getOERoot->result()) > 0)
|
||||
{
|
||||
$organisationseinheit = $getOERoot->result()[0];
|
||||
if ($organisationseinheit->oe_kurzbz == null)
|
||||
{
|
||||
show_error('No organisation unit present in the message');
|
||||
}
|
||||
else
|
||||
{
|
||||
$organisationRoot = $organisationseinheit->oe_kurzbz;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$addonAufnahmeUrls = $this->config->item('addons_aufnahme_url');
|
||||
@@ -66,10 +76,10 @@ class Redirect extends FHC_Controller
|
||||
if (isset($token)
|
||||
&& hasData($msg)
|
||||
&& is_array($addonAufnahmeUrls)
|
||||
&& hasData($rootOE)
|
||||
&& isset($addonAufnahmeUrls[$rootOE->retval[0]->oe_kurzbz]))
|
||||
&& $organisationRoot != null
|
||||
&& isset($addonAufnahmeUrls[$organisationRoot]))
|
||||
{
|
||||
redirect($addonAufnahmeUrls[$rootOE->retval[0]->oe_kurzbz] . '?token=' . $token);
|
||||
redirect($addonAufnahmeUrls[$organisationRoot] . '?token=' . $token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user