Ver Mensaje Individual
  #55 (permalink)  
Antiguo 26/11/2011, 11:40
Avatar de memp500
memp500
 
Fecha de Ingreso: octubre-2011
Ubicación: venezuela
Mensajes: 40
Antigüedad: 12 años, 11 meses
Puntos: 0
Respuesta: inicio de sesion

en sidebar.php aun no hay nada

en sistem.php

Código PHP:
Ver original
  1. <?
  2. if(empty($_GET['seccion'])) {
  3.  include("sec/inicio.php");
  4.  } else {
  5.  if(file_exists("sec/".$_GET['seccion'].".php")) {
  6.  include("sec/".basename($_GET['seccion']).".php");
  7.  } else {
  8.  
  9.  echo '<table border=0 cellpadding=0 cellspacing=0>
  10. <tr>
  11. <td width=85%><b>Error 404</b><br><br>No se encuentra el archivo, intentelo de nuevo o Pruebe mas tarde </b></td>
  12. </tr>
  13. </table>';
  14.  }
  15. }
  16. ?>

inicio.php que es el de default ensistema.php
Código PHP:
Ver original
  1. <?php
  2. if (!function_exists("GetSQLValueString")) {
  3. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  4. {
  5.   if (PHP_VERSION < 6) {
  6.     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  7.   }
  8.  
  9.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  10.  
  11.   switch ($theType) {
  12.     case "text":
  13.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  14.       break;    
  15.     case "long":
  16.     case "int":
  17.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  18.       break;
  19.     case "double":
  20.       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  21.       break;
  22.     case "date":
  23.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  24.       break;
  25.     case "defined":
  26.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  27.       break;
  28.   }
  29.   return $theValue;
  30. }
  31. }
  32.  
  33. $colname_acceso_usuarios = "-1";
  34. if (isset($_SESSION['MM_Username'])) {
  35.   $colname_acceso_usuarios = $_SESSION['MM_Username'];
  36. }
  37. mysql_select_db($database_config, $config);
  38. $query_acceso_usuarios = sprintf("SELECT id_usuario, primer_apellido, segundo_apellido, primer_nombre, segundo_nombre, usuario, pass, email, cargo, nivel FROM ft_usuarios WHERE usuario = %s", GetSQLValueString($colname_acceso_usuarios, "text"));
  39. $acceso_usuarios = mysql_query($query_acceso_usuarios, $config) or die(mysql_error());
  40. $row_acceso_usuarios = mysql_fetch_assoc($acceso_usuarios);
  41. $totalRows_acceso_usuarios = mysql_num_rows($acceso_usuarios);
  42. ?>
  43. <?php
  44. // *** Validate request to login to this site.
  45. if (!isset($_SESSION)) {
  46. }
  47.  
  48. $loginFormAction = $_SERVER['PHP_SELF'];
  49. if (isset($_GET['accesscheck'])) {
  50.   $_SESSION['PrevUrl'] = $_GET['accesscheck'];
  51. }
  52.  
  53. if (isset($_POST['usuario'])) {
  54.   $loginUsername=$_POST['usuario'];
  55.   $password=$_POST['pass'];
  56.   $MM_fldUserAuthorization = "";
  57.   $MM_redirectLoginSuccess = "index.php?seccion=welcome";
  58.   $MM_redirectLoginFailed = "index.php?seccion=falleuser";
  59.   $MM_redirecttoReferrer = false;
  60.   mysql_select_db($database_config, $config);
  61.  
  62.   $LoginRS__query=sprintf("SELECT usuario, pass FROM ft_usuarios WHERE usuario=%s AND pass=%s",
  63.     GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
  64.    
  65.   $LoginRS = mysql_query($LoginRS__query, $config) or die(mysql_error());
  66.   $loginFoundUser = mysql_num_rows($LoginRS);
  67.   if ($loginFoundUser) {
  68.      $loginStrGroup = "";
  69.    
  70.     //declare two session variables and assign them
  71.     $_SESSION['MM_Username'] = $loginUsername;
  72.     $_SESSION['MM_UserGroup'] = $loginStrGroup;      
  73.  
  74.     if (isset($_SESSION['PrevUrl']) && false) {
  75.       $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; 
  76.     }
  77.     header("Location: " . $MM_redirectLoginSuccess );
  78.   }
  79.   else {
  80.     header("Location: ". $MM_redirectLoginFailed );
  81.   }
  82. }
  83. ?>
  84. <div id="content-box">
  85.         <div class="padding">
  86.             <div class="login" id="element-box">
  87.                 <div class="t">
  88.                     <div class="t">
  89.                         <div class="t"></div>
  90.                     </div>
  91.                 </div>
  92.                 <div class="m">
  93.  
  94.                     <h1>Ingreso de Usuarios Registrados</h1>
  95.                    
  96.                             <div id="section-box">
  97.             <div class="t">
  98.                 <div class="t">
  99.                     <div class="t"></div>
  100.                 </div>
  101.             </div>
  102.             <div class="m">
  103.                 <form ACTION="<?php echo $loginFormAction; ?>" style="clear: both;" id="form-login" name="login" method="POST">
  104.     <p id="form-login-username">
  105.         <label for="modlgn_username">Usuario</label>
  106.         <input type="text" size="15" class="inputbox" id="modlgn_username" name="usuario">
  107.     </p>
  108.  
  109.     <p id="form-login-password">
  110.         <label for="modlgn_passwd">Contraseña</label>
  111.         <input type="password" size="15" class="inputbox" id="modlgn_passwd" name="pass">
  112.     </p>
  113.         <p style="clear: both;" id="form-login-lang">
  114.        
  115.     <div class="button_holder">
  116.     <div class="button1">
  117.         <div class="next">
  118.             <a onclick="login.submit();">
  119.                 Entrar</a>
  120.  
  121.         </div>
  122.     </div>
  123.     </div>
  124.     <div class="clr"></div>
  125.     <input type="submit" value="Entrar" style="border: 0; padding: 0; margin: 0; width: 0px; height: 0px;">
  126.    
  127.    
  128.     </form>
  129. <div class="clr"></div>
  130.             </div>
  131. <div class="b">
  132.                 <div class="b">
  133.                     <div class="b"></div>
  134.                 </div>
  135.             </div>
  136.         </div>
  137.        
  138.                     <p>Ingresa un nombre de usuario y contraseña validos para acceder al Sistema.</p>
  139.                     <p>
  140.                         <a href="javascript:history.back(1)">Regresar a la Pagina Anterior</a>
  141.                     </p>
  142.                     <div id="lock"></div>
  143.                     <div class="clr"></div>
  144.                 </div>
  145.     <div class="h_green" id="border-top">
  146.         <div>
  147.             <div>
  148.                 <div class="adminform">Insurance Broker Sistem By ARTEM LABS, CA</div>
  149.             </div>
  150.         </div>
  151.     </div>
  152.                 <div class="b">
  153.                     <div class="b">
  154.                         <div class="b"></div>
  155.                     </div>
  156.                 </div>
  157.             </div>
  158.                         <div class="clr"></div>
  159.         </div>
  160. </div>
  161.     <div id="border-bottom"><div><div></div></div>
  162. </div>
  163.     <?php
  164. mysql_free_result($acceso_usuarios);
  165. ?>

welcome.php si el loguin esta bien

Código PHP:
Ver original
  1. <?php
  2. if (!isset($_SESSION)) {
  3. }
  4. $MM_authorizedUsers = "";
  5. $MM_donotCheckaccess = "true";
  6.  
  7. // *** Restrict Access To Page: Grant or deny access to this page
  8. function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
  9.   // For security, start by assuming the visitor is NOT authorized.
  10.   $isValid = False;
  11.  
  12.   // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
  13.   // Therefore, we know that a user is NOT logged in if that Session variable is blank.
  14.   if (!empty($UserName)) {
  15.     // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
  16.     // Parse the strings into arrays.
  17.     $arrUsers = Explode(",", $strUsers);
  18.     $arrGroups = Explode(",", $strGroups);
  19.     if (in_array($UserName, $arrUsers)) {
  20.       $isValid = true;
  21.     }
  22.     // Or, you may restrict access to only certain users based on their username.
  23.     if (in_array($UserGroup, $arrGroups)) {
  24.       $isValid = true;
  25.     }
  26.     if (($strUsers == "") && true) {
  27.       $isValid = true;
  28.     }
  29.   }
  30.   return $isValid;
  31. }
  32.  
  33. $MM_restrictGoTo = "index.php";
  34. if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {  
  35.   $MM_qsChar = "?";
  36.   $MM_referrer = $_SERVER['PHP_SELF'];
  37.   if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  38.   if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
  39.   $MM_referrer .= "?" . $QUERY_STRING;
  40.   $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  41.   header("Location: ". $MM_restrictGoTo);
  42.   exit;
  43. }
  44. ?>
  45. <center><table width="100%" border="0" cellspacing="0">
  46.   <tr>
  47.     <td><table border="0" cellspacing="0">
  48.   <tr>
  49.     <td><center><h1>Bienvenido</h1></center><br /><center><? echo "".$_SESSION['MM_Username'] ;?></center><br /></td>
  50.   </tr>
  51.     <tr>
  52.     <td>&nbsp;</td>
  53.   </tr>
  54.   <tr>
  55.     <td><table width="700px" border="0" cellspacing="0">
  56.   <tr>
  57.     <td><a href="index.php?seccion=buscar">Busqueda</td>
  58.     <td>Financiamiento</td>
  59.     <td>Siniestros</td>
  60.   </tr>
  61. </table>
  62. </td>
  63.   </tr>
  64. </table>
  65. </td>
  66.   </tr>
  67. </table>
  68. </center>

y luego el footer que hay ya no hay ningun error
__________________
crear soluciones y oportunidades de desarrollo y crecimiento