!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_tdfonline/proyectos/toba_usuarios/php/perfiles/perfil_funcional/   drwxr-xr-x
Free 14.57 GB of 61.93 GB (23.53%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     arbol_perfiles_funcionales.php (6.71 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php 
class arbol_perfiles_funcionales extends toba_ei_arbol
{
    protected 
$nodos_activos = array();
    protected 
$nodos_inactivos = array();
    
    protected function 
generar_campos_hidden()
    {
        
parent::generar_campos_hidden();
        echo 
toba_form::hidden($this->_submit.'__nodos_deseleccionados''');
        echo 
toba_form::hidden($this->_submit.'__nodos_seleccionados''');
    }

    private function 
cargar_estado_post()
    {
        
$id_activos $this->_submit.'__nodos_seleccionados';
        if (isset(
$_POST[$id_activos]) && $_POST[$id_activos] != '') {
            
$this->nodos_activos explode(apex_qs_sep_interno$_POST[$id_activos]);
        }
        
        
$id_inactivos $this->_submit.'__nodos_deseleccionados';
        if (isset(
$_POST[$id_inactivos]) && $_POST[$id_inactivos] != '') {
            
$this->nodos_inactivos explode(apex_qs_sep_interno$_POST[$id_inactivos]);
        }
    }
    
    function 
disparar_eventos()
    {
        
$this->cargar_estado_post();
        
        
//Aca valido los ids contra los enviados, para que nadie intente pasarse de vivo.
        
foreach ($this->nodos_activos as $id_nodo) {
            
$this->validar_id_nodo_recibido($id_nodo);
        }        
        foreach (
$this->nodos_inactivos as $id_nodo) {
            
$this->validar_id_nodo_recibido($id_nodo);
        }
    
        
//Transmito el estado recuperado del post a cada nodo.
        
if (isset($this->_nodos_inicial) && ! empty($this->_nodos_inicial)) {
            
$raiz $this->_nodos_inicial[0];
            
$raiz->propagar_estado_hijos($this->nodos_activos$this->nodos_inactivos);
        }
        
        
parent::disparar_eventos();
    }
    
    function 
generar_fila_nodo($nodo$nivel)
    {
        
$nodo->desactivar_envio_inputs();
        return 
parent::generar_fila_nodo($nodo$nivel);
    }
    
    function 
extender_objeto_js()
    {
        
parent::extender_objeto_js();
        
$id_js $this->objeto_js;
        
$id_gral $this->_submit;
        
$img_acceso toba_recurso::imagen_toba('aplicar.png'false);
        
$img_sin_acceso toba_recurso::imagen_toba('prohibido.png'false);

        
//Busco el estado de cada uno de los hijos involucrados en el pedido de pagina
        
$estado = array('activos' => array(), 'inactivos' => array());                
        if (isset(
$this->_nodos_inicial) &&  ! empty($this->_nodos_inicial)) {
            
$raiz $this->_nodos_inicial[0];
            if (
$raiz->tiene_hijos_cargados()) {
                foreach (
$raiz->get_hijos() as $nodo) {
                    
$aux $nodo->recuperar_estado_recursivo();
                    
$estado['activos'] = array_merge($estado['activos'], $aux['activos']);
                    
$estado['inactivos'] = array_merge($estado['inactivos'], $aux['inactivos']);                    
                }
            }                
        }
        
        
//Genero un par de arreglos que van a servir como lista en js
        
$ids_activos = (! empty($estado['activos'])) ? array_fill_keys($estado['activos'], true): array();
        
$ids_desactivados = (! empty($estado['inactivos'])) ? array_fill_keys($estado['inactivos'], true): array();
        echo 
' var ' $id_js '_items_activos = '  toba_js::arreglo($ids_activostrue) . "; \n" ;
        echo 
' var ' $id_js '_items_desactivados = '  toba_js::arreglo($ids_desactivadostrue) ."; \n" ;                
        
        echo 
"            
            
$id_js.cambiar_acceso = function(id_input)
            {
                var id_elemento = '
$id_gral' + '_' + id_input;                     
                if (isset(
{$this->objeto_js}_items_activos[id_input])) {            //Esta visible, hay que ocultarlo                    
                    delete(
{$this->objeto_js}_items_activos[id_input]);
                    
{$this->objeto_js}_items_desactivados[id_input] = true;
                    $$(id_elemento + '_acceso_img').src = '
$img_sin_acceso';                        
                } else if (isset(
{$this->objeto_js}_items_desactivados[id_input])) {        //Esta oculto, hay que mostrarlo                    
                    delete(
{$this->objeto_js}_items_desactivados[id_input]);
                    
{$this->objeto_js}_items_activos[id_input] = true;
                    $$(id_elemento + '_acceso_img').src = '
$img_acceso';                                    
                }
            }
            
            
$id_js.marcar = function(id_input, valor)
            {                
                var id_final = '
$id_gral' + '_' + id_input + '_carpeta';
                var padre = $$(id_final).parentNode.parentNode;        
                var nodo = this.buscar_primer_marca(padre, 'UL');
                if (nodo) {        
                    for (var i=0; i < nodo.childNodes.length; i++) {
                        var hijo = nodo.childNodes[i];
                        if (hijo.tagName && (hijo.tagName == 'LI')) {
                            if (! this.buscar_primer_marca(hijo, 'UL')) {
                                this.cambiar_estado_acceso(hijo, valor);
                            } else {
                                this.marcar_recursivo(hijo, valor);
                            }
                        }
                    }
                }
            }
                        
            
$id_js.marcar_recursivo = function(carpeta, valor) 
            {
                var marca_carpeta = this.buscar_primer_marca(carpeta, 'SPAN');
                if (marca_carpeta) {
                    for (var i=0; i < marca_carpeta.childNodes.length; i++) {
                        var hc = marca_carpeta.childNodes[i];
                        if (hc.tagName && (hc.tagName == 'INPUT')) {
                            $$(hc.id).value = valor;
                            $$(hc.id).checked = (valor == 0) ? true : false;
                        }
                    }
                }
                var nodo = this.buscar_primer_marca(carpeta, 'UL');        
                for (var i=0; i < nodo.childNodes.length; i++) {
                    var hijo = nodo.childNodes[i];
                    if (hijo.tagName && (hijo.tagName == 'LI')) {
                        if (!this.buscar_primer_marca(hijo, 'UL')) {
                            this.cambiar_estado_acceso(hijo, valor);
                        } else {
                            this.marcar_recursivo(hijo, valor);
                        }
                    }
                }
            }
            
            
$id_js.cambiar_estado_acceso = function(nodo, valor)
            {
                for (var i=0; i < nodo.childNodes.length; i++) {
                    if (nodo.childNodes[i].tagName == 'SPAN') {
                        var hijo = nodo.childNodes[i];
                        for (var j=0; j < hijo.childNodes.length; j++) {
                            if (hijo.childNodes[j].tagName == 'IMG') {    
                                hijo.childNodes[j].onclick();
                            }
                        }
                    }
                }
            }
            
            
$id_js.buscar_primer_marca = function (nodo, marca) {
                for (var i=0; i < nodo.childNodes.length; i++) {
                    if (nodo.childNodes[i].tagName == marca) {
                        return nodo.childNodes[i];
                    }
                }
                return false;
            }
            
            
$id_js.submit = function()
            {                
                var padre_esta_en_proceso = this.controlador && !this.controlador.en_submit();
                if (padre_esta_en_proceso) {
                    return this.controlador.submit();
                }
                if (this._evento) {
                    //Si es la selección de una semana marco la semana
                    if (this._evento.id == 'ver_propiedades') {
                        document.getElementById(this._input_submit + '__seleccion').value = this._evento.parametros;
                    }
                    //Marco la ejecucion del evento para que la clase PHP lo reconozca
                    document.getElementById(this._input_submit).value = this._evento.id;            
                }
                document.getElementById(this._input_submit + '__apertura_datos').value = this.datos_apertura();                

                //Agrego como lista los nodos seleccionados y deseleccionados
                var claves = [];
                for (var i in 
{$id_js}_items_activos) {
                    claves.push(i);
                }
                document.getElementById('
{$id_gral}__nodos_seleccionados').value = claves.join(toba_hilo_separador_interno);

                var claves = [];                
                for (var i in 
{$id_js}_items_desactivados) {
                    claves.push(i);
                }
                document.getElementById('
{$id_gral}__nodos_deseleccionados').value = claves.join(toba_hilo_separador_interno);                
                
            }
        "
;
    }
}

?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.8258 ]--