mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-04 13:54:51 -04:00
Reports module now has checks on the required submodules when entering direct urls
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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, '@').">";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user