<?php
class securitygdFilter{
  
	public function execute($block){ 
		
    $this->app				= SF_APP;
    $this->block			=	$block;
		$this->action			= Parameter::getInstance()->getActions();
		$this->module			= Parameter::getInstance()->getModule();
		$this->securityTaskGD 	= 	"mnu.".$this->app.$this->block.".".$this->module.".".$this->action;

		//recuperando user
		$this->o_sfUser 		= myUser::getUser();

		$this->preExecuteGD();
		
	}

	function preExecuteGD(){
    
    if($this->o_sfUser->hasTask($this->securityTaskGD)){
      if (!$this->o_sfUser->getPerm($this->securityTaskGD)){
        
        Parameter::getInstance()->actions = 'perms';
      }
			
			if ($this->o_sfUser->mnuTask['TaskType'] != 'proc'){
        Parameter::getInstance()->actions = 'perms';
			}
    }else{
      echo "Por favor registrar en la tabla \"mnu_task\" : ".$this->securityTaskGD."<br>";
      Parameter::getInstance()->actions = 'perms';
    }
    
  }
  
}
