Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/10/2016, 05:53
Avatar de skywolker
skywolker
 
Fecha de Ingreso: julio-2011
Ubicación: España
Mensajes: 195
Antigüedad: 13 años, 3 meses
Puntos: 8
De acuerdo Acceso por niveles obtencion de data ¿Como trabajan los softwars de seguridad?

Espero que os guste comenten.


escalera_data.php
Código PHP:
<?php

class escalera_data {


  private 
$data= array();

   public function 
data_fun(){

  echo 
"<br>Accediendo data_fun() <b> Acceso del Nivel: 0</b>";


          function 
arrays(){

            echo 
"<br>Accediendo arrays() <b> Acceso del Nivel: 0</b>";

               
$entrada=@$_GET['true'];
                                      if(
$entrada !== 'true'):

                                        function 
arrays2(){

                                            echo 
"<br>Esto es privado ¡Los datos estas reservados aqui.! <b> Acceso del Nivel: 1</b>";
                                            echo 
"<br>¿Quieres consultar datos? Haz click aqui: <a href='?metodos=metodos&true=true'>Aceptar</a> ";

                                            
//set get  isset
                                            
include('private/metodos.php');

                                                    }

                                           else:

                                                    function 
arrays2(){
                                                      echo 
"<br>Usted acaba de acceder a los datos privado <b> Acceso del Nivel: 2</b> ";

                                                      echo 
"<br> ¿Quieres volverlo privado? Haz click aqui: <a href='?true=false'>Aceptar</a>' ";

                                                           @include(
'private/'.@$_GET["metodos"].'.php');

                                                           
$imprime=new escalera_magica_2();
                                                            
$name_value=$imprime->name='valor2';
                                                           echo 
$imprime->name;

                                                           
var_dump(isset( $name_value));
                                                           echo 
"<br>";
                                                           echo 
"Eliminando.....";
                                                           unset(
$name_value);
                                                           echo 
"<br>";
                                                           echo 
"Eliminado.";
                                                           echo 
"<br>";
                                                           
var_dump(isset( $name_value));
                                                           echo 
"<br>";

                                                             
//return data

                                                           
echo "<br>Deseo acceder directamente al nivel: 3 <b> Acceso del Nivel: 2</b> ";

                                                           echo 
"<br> ¿Quieres acceder? Haz click aqui: <a href='?metodos=metodos&nivel=3&true=true'>Aceptar</a>' ";


                                                                                           function 
niveles() {

                                                                               echo 
"Accediendo a niveles:";

                                                                               
$nivel=@$_GET['nivel'];

                                                                                                               if(
$nivel !== '3'):

                                                                                                                                    function 
nivel_3() {

                                                                                                                              
//datos nivel 3

                                                                                                                                  
echo "<br>Esto es privado ¡Los datos estas reservados aqui.! <b> Acceso del Nivel: 3</b>";
                                                                                                                                echo 
"<br>¿Quieres consultar datos? Haz click aqui: <a href='?metodos=metodos&nivel=3&true=true'>Aceptar</a> ";

                                                                                                                                                                          
//set get  isset
                                                                                                                            ##### include('private/metodos2.php');
                                                                                                                                
echo "<i>Esta vacio no hay datos disponibles...</i>";


                                                                                                                            }
//nivel 3

                                                                                                                              
else:
                                                                                                                                      function 
nivel_3 (){

                                                                                                                                        
#####llamada de datos nivel 3

                                                                                                                                      
echo "<br>Fin de nivel no hay mas datos <b> Acceso del Nivel: 3</b> ";

                                                                                                                                      echo 
"<br> ¿Desea Reiniciar? Haz click aqui: <a href='?true=false'>Aceptar</a>' ";


                                                                                                                                      echo 
"<i>No existe llamada de datos...</i>";

                                                                                                                                      }  
//nivel 4

                                                                                                                                
endif;



                                                                                                         }
//niveles

                                                                                                         
niveles();
                                                                                                         
nivel_3();


                                                          }
//array 2

                                             
endif;



                        }







             
arrays();
             
arrays2();

       }






 }

?>
  <?php
 
//imprime

 
$imprime=new escalera_data();

 
$imprime=$imprime->data_fun();




?>

private/metodos.php

Código PHP:
<?php

class escalera_magica_2 {


  private 
$data= array();


public function 
__set($name,$arguments){
  echo 
"<br>Estableciendo '$name' a '$arguments'<br>";

$this->data[$name]=$arguments;
echo 
"<br>__set data name : argumentos: ".$this->data[$name];

}
public function 
__get($name){
echo 
"<br>consulando get<br>";
if( 
array_key_exists($name,$this->data)  ){ echo "<br>Existe get name<br>"; }else{ echo "No existe get name<br>"; }

}

  public function 
__isset($name){

    echo   
"<br>Esta definido name : ".$this->data[$name];
  return 
false;
  isset(
$this->data[$name]) ;

 return 
true;

  }

  public function 
__unset($name){

  unset(
$this->data[$name]);
  echo  
"Eliminado .";
    }

}
//escalera magica 2

 
?>