Tema: form-
Ver Mensaje Individual
  #38 (permalink)  
Antiguo 08/02/2004, 11:49
Avatar de Sebastian1046
Sebastian1046
 
Fecha de Ingreso: junio-2003
Mensajes: 278
Antigüedad: 20 años, 10 meses
Puntos: 0
hola capos encontre otra forma de hacer la administración

http://web.kbm.com.ar/akorps/seba1046/index.php?ir=6

nombre = seba
password = seba

diganme si este sistema es seguro o no... por que parece seguro....

Código PHP:
<?

$selfSecure 
1;
$shellUser  "seba";
$shellPswd  "seba";

$adminEmail "admin email here";
$fromEmail  $HTTP_SERVER_VARS["SERVER_ADMIN"];

$Version "";
if(
$selfSecure){
    if ((
$PHP_AUTH_USER!=$shellUser)||($PHP_AUTH_PW!=$shellPswd)) {
       
Header('WWW-Authenticate: Basic realm=Administración');
       
Header('HTTP/1.0 401 Unauthorized');
       echo 
"<html>
         <head>
         <title>Error - Access Denied</title>
         </head>
         <h1>Access denied</h1>
         A warning message has been sent to the webmaster.  Your IP address has also been recorded
         <hr>
         <em>$Version</em>"
;
       if(isset(
$PHP_AUTH_USER)){
          
$warnMsg ="
 Somebody tried to access the script on: [url]http://[/url]"
.$HTTP_SERVER_VARS["HTTP_HOST"]."$PHP_SELF
 using the wrong username or password:
 
 Date: "
.date("Y-m-d H:i:s")."
 IP: "
.$HTTP_SERVER_VARS["REMOTE_ADDR"]."
 User Agent: "
.$HTTP_SERVER_VARS["HTTP_USER_AGENT"]."
 username used: $PHP_AUTH_USER
 password used: $PHP_AUTH_PW
 
       "
;
          
mail($adminEmail,"Unauthorized Access",$warnMsg,
          
"From: $fromEmail\nX-Mailer:$Version AutoWarn System");
       }
       exit;
    }
}

if(!
$oCols)$oCols=$termCols;
if(!
$oRows)$oRows=$termRows;

?>

<?
include("admin/config.php");
include(
"admin/variables.php");
?>
<html>
<head>
<title><? echo ($title) ? ($title) : ("Administración General"); ?></title>
<link rel="stylesheet" href="<?=$dir_img?>/<?=$style?>.css" type="text/css">
</head>
<body bgcolor="#F7F7F7"><br><br>
<center>
<?    
echo "
<table bgcolor=#666666 cellspacing=1 cellpadding=3 align=center width=400>
<tr><td bgcolor=#FFFFFF>
<table align=right bgcolor=#FFFFFF width=400>
<tr>
  <td bgcolor=#FFFFFF><font face=Tahoma size=2>
    <div align=center>
      <table width=340 border=0 cellspacing=10 cellpadding=0>
        <tr>
          <td><div align=center><font face=Tahoma size=3><b>Administrador Web <font color=#666666 size=2>by $wm</font></b></font><font size=2>&nbsp;</font></div></td>
        </tr>
      </table>
      </div>
  </td>
</tr>
<tr>
  <td bgcolor=#FFFFFF></td>
</tr>
<tr>
     <td><table width=267 border=0 align=center cellpadding=0 cellspacing=5>
      <tr>
        <td><div align=center><font size=2 face=Verdana, Arial, Helvetica, sans-serif>
<p align=center><font size=1 face=Tahoma><img src='img/icon_mini_lock.gif' width='11' height='11' align='texttop'><a href=>
<font color=#006699>Administrar las Noticias</font></a></font></p>
</font></div></td>
      </tr>
    </table>
    <table width=267 border=0 align=center cellpadding=0 cellspacing=5>
        <tr>
          <td><div align=center><font size=2 face=Verdana, Arial, Helvetica, sans-serif>
              <p align=center><font size=1 face=Tahoma><img src='img/icon_mini_lock.gif' width='11' height='11' align='texttop'> <a href=> <font color=#006699>Administrar el Libro de Visitas</font></a></font></p>
          </font></div></td>
        </tr>
      </table>
    <table width=267 border=0 align=center cellpadding=0 cellspacing=5>
        <tr>
          <td><div align=center><font size=2 face=Verdana, Arial, Helvetica, sans-serif>
              <p align=center><font size=1 face=Tahoma><img src='img/icon_mini_lock.gif' width='11' height='11' align='texttop'> <a href=> <font color=#006699>Administrar los Links</font></a></font></p>
          </font></div></td>
        </tr>
      </table>
    <table width=267 border=0 align=center cellpadding=0 cellspacing=5>
        <tr>
          <td><div align=center><font size=2 face=Verdana, Arial, Helvetica, sans-serif>
              <p align=center><font size=1 face=Tahoma><img src='img/icon_mini_lock.gif' width='11' height='11' align='texttop'> <a href=> <font color=#006699>Administrar las Descargas</font></a></font></p>
          </font></div></td>
        </tr>
      </table>
</tr>
<tr>
  <td>
</tr>
</table>
</table>
"
;
?>
si esto me sirve tengo 2 dudas:

1°- como pongo una variable en esta linea
Código PHP:
Header('WWW-Authenticate: Basic realm=Administración'); 
digamos, donde dice administracion, yo quiero poner $nombrepagina pero no me lo reconoce como variable, si no como texto, como puedo poner para q' reconosca que el nombre es una variable?

2°- si la autenticacion es incorrecta me corta la pagina digamos que no sigue cargando el resto de mi pagina como puedo hacer para que paresca el mensaje
Access denied
"A warning message has been sent to the webmaster. Your IP address has also been recorde."
y siga cargando el index.php?

saludos y gracias
__________________
Agradesco infinitamente a toda la gente del foro que me ayudo/a.

Última edición por Sebastian1046; 08/02/2004 a las 12:10