Exemple #1
0
 public function __construct()
 {
     Sfphp_Sesion::get();
     $peticion = Sfphp_Peticion::get();
     $clase = NULL;
     if (!is_null($peticion['_modulo'])) {
         $clase = ucwords($peticion['_modulo']) . "_";
     }
     $clase .= "Controladores_" . ucwords($peticion['_control']);
     try {
         $objSeguridad = new Seguridad();
         if ($objSeguridad->validarAcceso(ucwords($peticion['_control']))) {
             $objClase = new $clase();
             if (is_callable(array($objClase, $peticion['_accion']))) {
                 call_user_func(array($objClase, $peticion['_accion']));
             } else {
                 throw new Sfphp_Error("La accion {$peticion['_accion']} no esta definida en {$clase}", 1);
             }
         } else {
             throw new Sfphp_Error("No tienes privilegios para acceder a {$clase}::{$peticion['_accion']}", 1);
         }
     } catch (Sfphp_Error $e) {
         Sfphp_Logs::procesa($e);
     }
 }
Exemple #2
0
 public function __construct()
 {
     # Limpiar cache expirada
     Sfphp_Cache::expirate();
     # Aplicar la sesión
     Sfphp_Sesion::get();
     $peticion = Sfphp_Peticion::get();
     $clase = NULL;
     if (!is_null($peticion['_modulo'])) {
         $clase = ucwords($peticion['_modulo']) . "_";
     }
     $clase .= "Controladores_" . ucwords($peticion['_control']);
     try {
         $objSeguridad = new Seguridad();
         if ($objSeguridad->validarAcceso(ucwords($peticion['_control']))) {
             $objClase = new $clase();
             if (is_callable(array($objClase, $peticion['_accion']))) {
                 call_user_func(array($objClase, $peticion['_accion']));
             } else {
                 header("Location: " . BASE_URL . "Etc/Errors/process.php?code=401");
                 die;
             }
         } else {
             trigger_error("La accion {$peticion['_accion']} no esta definida en {$clase}", E_USER_ERROR);
         }
     } catch (Sfphp_Error $e) {
         Sfphp_Log::error($e);
     }
 }
Exemple #3
0
 /**
  * Muestra la pantalla del POS
  * @return none
  */
 public function pos()
 {
     $acceso = Sfphp_Sesion::get('acceso');
     $impuestos = $this->modeloImpuestos->getActual();
     $this->_vista->ivaPorcentaje = $impuestos[0]['ivaPorcentaje'];
     $this->_vista->iepsPorcentaje = $impuestos[0]['iepsPorcentaje'];
     $this->_vista->clientes = $this->modeloClientes->get();
     $this->_vista->vendedor = $acceso['vendedor'];
     $this->vistaPOS;
 }