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:
Paolo
2017-11-14 15:01:36 +01:00
parent 53da4b1f34
commit 1f6a0fc386
2 changed files with 67 additions and 30 deletions
+19 -9
View File
@@ -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);
}
}
}