Reports module now has checks on the required submodules when entering direct urls

This commit is contained in:
jekkos-t520
2014-10-16 18:31:35 +02:00
parent 7bcb1d7531
commit 7fad710277
2 changed files with 7 additions and 8 deletions

View File

@@ -12,14 +12,17 @@ class Reports extends Secure_area
parent::__construct('reports');
$method_name = $this->uri->segment(2);
$exploder = explode('_', $method_name);
$submodule_id = preg_match("/^(inventory)|([^_.]+)(?:_graph)?$/", $method_name, $matches);
var_dump($matches);
$submodule_id = preg_replace("/^(.*?)s?$/", "$1s", $matches[1]);
$submodule_id = preg_match("/(?:inventory)|([^_.]*)(?:_graph)?$/", $method_name, $matches);
$submodule_id = array_pop($matches);
if (count($matches) > 1)
{
$submodule_id = preg_replace("/^(.*?)s?$/", "$1s", $submodule_id);
}
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
// check access to report submodule
if (sizeof($exploder) > 1 && !$this->Employee->has_grant('reports_'.$submodule_id,$employee_id))
{
//redirect('no_access/'.$submodule_id.'/reports_' . $submodule_id);
redirect('no_access/'.$submodule_id.'/reports_' . $submodule_id);
}
$this->load->helper('report');
}

View File

@@ -610,10 +610,6 @@ class CI_Email {
*/
protected function _get_message_id()
{
$from = $this->_headers['Return-Path'];
$from = str_replace(">", "", $from);
$from = str_replace("<", "", $from);
return "<".uniqid('').strstr($from, '@').">";
}