mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-01-19 14:57:55 -05:00
Tom git-svn-id: svn+ssh://jekkos@svn.code.sf.net/p/opensourcepos/code/@24 c3eb156b-1dc0-44e1-88ae-e38439141b53
29 lines
836 B
PHP
29 lines
836 B
PHP
<?php
|
|
class Secure_area extends CI_Controller
|
|
{
|
|
/*
|
|
Controllers that are considered secure extend Secure_area, optionally a $module_id can
|
|
be set to also check if a user can access a particular module in the system.
|
|
*/
|
|
function __construct($module_id=null)
|
|
{
|
|
parent::__construct();
|
|
$this->load->model('Employee');
|
|
if(!$this->Employee->is_logged_in())
|
|
{
|
|
redirect('login');
|
|
}
|
|
|
|
if(!$this->Employee->has_permission($module_id,$this->Employee->get_logged_in_employee_info()->person_id))
|
|
{
|
|
redirect('no_access/'.$module_id);
|
|
}
|
|
|
|
//load up global data
|
|
$logged_in_employee_info=$this->Employee->get_logged_in_employee_info();
|
|
$data['allowed_modules']=$this->Module->get_allowed_modules($logged_in_employee_info->person_id);
|
|
$data['user_info']=$logged_in_employee_info;
|
|
$this->load->vars($data);
|
|
}
|
|
}
|
|
?>
|