function deleteByProfile($id_profile)
 {
     if ($this->db->delete($this->table, array('id_profile' => $id_profile)) === FALSE) {
         throw new Exception("Error in: TABLE:" . $this->table . ", FUNCTION:" . __FUNCTION__);
     }
     Helper_App_Log::write($this->lastQuery(), FALSE, Helper_App_Log::LOG_DELETE);
 }
 function __construct()
 {
     parent::__construct(MY_Controller::SYSTEM_APP);
     $this->load->file('application/modules/app/security_rol/permission.php');
     $this->permission = new Security_Rol_Permission($this->name_key);
     $this->permission->create = Helper_App_Session::isPermissionForModule($this->name_key, 'create');
     $this->permission->update = Helper_App_Session::isPermissionForModule($this->name_key, 'update');
     if (!Helper_App_Session::isLogin()) {
         $this->redirect('app/login');
         return;
     }
     if (!Helper_App_Session::inInactivity()) {
         $this->redirect('app/login_advanced');
         return;
     }
     if (Helper_App_Session::isBlock()) {
         $this->redirect('app/login_advanced');
         return;
     }
     if (!$this->permission->access) {
         Helper_App_Log::write("Rol: intento de acceso");
         $this->redirect('app/dashboard');
         return;
     }
 }
 public static function debugAll()
 {
     $MY =& MY_Controller::get_instance();
     $MY->libsession->setSessionGroup(self::$params_session['session_group']);
     $info = array(self::$params_session['session_group'] => $MY->libsession->getAll());
     Helper_Log::write(print_r($info, TRUE));
     Helper_App_Log::write($info, TRUE, Helper_App_Log::LOG_LOGIN);
 }
예제 #4
0
 function saveOrder(eModule $eModule)
 {
     try {
         $this->update(array('num_order' => $eModule->num_order), $eModule->id);
         Helper_App_Log::write($this->lastQuery(), FALSE, Helper_App_Log::LOG_UPDATE);
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
 function save(eSessionActivity &$eSessionActivity)
 {
     try {
         if (empty($eSessionActivity->id)) {
             $eSessionActivity->id = $this->genId();
             $this->insert($eSessionActivity->toData());
             Helper_App_Log::write($this->lastQuery(), FALSE, Helper_App_Log::LOG_INSERT);
         } else {
             $this->update($eSessionActivity->toData(FALSE), $eSessionActivity->id);
             Helper_App_Log::write($this->lastQuery(), FALSE, Helper_App_Log::LOG_UPDATE);
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
 function save(eConfigurationSystem &$eConfigurationSystem)
 {
     try {
         if (empty($eConfigurationSystem->id)) {
             $eConfigurationSystem->id = $this->genId();
             $this->insert($eConfigurationSystem->toData());
             Helper_App_Log::write($this->lastQuery(), FALSE, Helper_App_Log::LOG_INSERT);
         } else {
             $this->update($eConfigurationSystem->toData(TRUE), $eConfigurationSystem->id);
             Helper_App_Log::write($this->lastQuery(), FALSE, Helper_App_Log::LOG_UPDATE);
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
 function save(ePermission &$ePermission)
 {
     try {
         $row = $this->load($ePermission->id);
         if ($row->isEmpty()) {
             $ePermission->id = $this->genId();
             $this->insert($ePermission->toData());
             Helper_App_Log::write($this->lastQuery(), FALSE, Helper_App_Log::LOG_INSERT);
         } else {
             $this->update($ePermission->toData(FALSE), $ePermission->id);
             Helper_App_Log::write($this->lastQuery(), FALSE, Helper_App_Log::LOG_UPDATE);
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
 function __construct()
 {
     parent::__construct(MY_Controller::SYSTEM_APP);
     $this->load->file('application/modules/app/system_module/permission.php');
     $this->permission = new System_Module_Permission($this->name_key);
     if (!Helper_App_Session::isLogin()) {
         $this->redirect('app/login');
         return;
     }
     if (!Helper_App_Session::inInactivity()) {
         $this->redirect('app/login_advanced');
         return;
     }
     if (Helper_App_Session::isBlock()) {
         $this->redirect('app/login_advanced');
         return;
     }
     if (!$this->permission->access) {
         Helper_App_Log::write("Module: intento de acceso");
         $this->redirect('app/dashboard');
         return;
     }
 }
 function __construct()
 {
     parent::__construct(MY_Controller::SYSTEM_APP);
     $this->load->file('application/modules/app/utility_company_and_company_branch/permission.php');
     $this->permission = new Utility_Company_And_Company_Branch_Permission($this->name_key);
     if (!Helper_App_Session::isLogin()) {
         $this->redirect('app/login');
         return;
     }
     if (!Helper_App_Session::inInactivity()) {
         $this->redirect('app/login_advanced');
         return;
     }
     if (Helper_App_Session::isBlock()) {
         $this->redirect('app/login_advanced');
         return;
     }
     if (!$this->permission->access) {
         Helper_App_Log::write("Mantenimiento de Empresa y Sucursales: intento de acceso");
         $this->redirect('app/dashboard');
         return;
     }
 }
예제 #10
0
 function updatePassword($id_user, $password)
 {
     // throw new Exception
     parent::update(array('password' => md5($password)), $id_user);
     Helper_App_Log::write($this->lastQuery(), FALSE, Helper_App_Log::LOG_UPDATE);
 }