Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/03/2011, 16:02
Avatar de victor5atodogas
victor5atodogas
 
Fecha de Ingreso: junio-2010
Mensajes: 447
Antigüedad: 13 años, 10 meses
Puntos: 2
Como identificarse en 2 sitios a la vez - Integrar Prestashop y PHPBB

Pues la pregunta aunque parece rara es muy simple:

Estoy uniendo PHPBB + Prestashop y necesito saber como puedo identificarme en PHPBB desde el formulario de autentificacion de Prestashop.

Actualmente, tengo una pagina aparte (fuera de PHPBB y de Prestashop)en la que si introduces username y pasword te identifica en PHPBB y te redirecciona a la pagina que quiera.

Hasta ahi facil; pero claro, como hago para que en el formulario de Prestashop,t e identifiques y en el de PHPBB tambien.

Hay que tener en cuenta, que el codigo que utilizo para loguerame desde fuera de PHPBB en el mismo es:

Código:
<?php
define('IN_PHPBB', true); // se define que se va a usar phpbb.
$site_root_path="";
$phpbb_root_path = $_SERVER['DOCUMENT_ROOT'] .'/Foro/';
$phpbb_url_path = 'http://www.midominio.com/Foro/'; // la url hacia tu phpbb3
$phpEx = substr(strrchr(__FILE__, '.'), 1); // tipo de extension
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'config.' . $phpEx);

$user->session_begin();
$auth->acl($user->data); 
?>

<?php 
if($user->data['is_registered']) 
{ 
//en phpbb3_ suponemos que el prefijo de la tabla es phpbb3_ 
$conexion = mysql_connect('localhost', 'username', 'pass);
mysql_select_db('tienda');
$avvy = "SELECT * FROM phpbb_users WHERE user_id =" . $user->data['user_id']; 
$result = mysql_query($avvy) or die (mysql_error()); 

while($row = mysql_fetch_array($result)) 
{ 
$link = $row['user_avatar']; 
$width = $row['user_avatar_width']; 
$height = $row['user_avatar_height']; 
}?> 
<a href="<?php echo $phpbb_url_path?>memberlist.php?mode=viewprofile&amp;u=<?php echo $user->data['user_id'];?> " target="_self"></a> 


<table width="145" height="392" border="0" cellpadding="0" cellspacing="0" > 
  <tr> 
    <td align="center" valign="top"> 
        <table width="145" border="0" cellspacing="0" cellpadding="0"> 
          <tr> 
            <td align="center">Hola <a href="<?php echo $phpbb_url_path?>memberlist.php?mode=viewprofile&amp;u=<?php echo $user->data['user_id'];?> " target="_self"> <?php echo $user->data['username'];?> </a>!</td> 
          </tr> 
        </table> 
      <table width="135" height="255" border="0" cellpadding="0" cellspacing="0"> 
        <tr> 
            <td height="250" align="center" valign="middle"><img src="<?php echo $phpbb_url_path?>download/file.php?avatar=<? echo $link?> " border="0" width="<? echo $width?> " height=" <? echo $height?>" alt='Avatar' /></td> 
        </tr> 
      </table> 
      <table width="145" border="0" cellspacing="0" cellpadding="0"> 
          <tr> 
            <td align="center" valign="middle" class="Estilo5"><span class="Estilo20"><a href="<?php echo $phpbb_url_path?>ucp.php" >Visita tu<br /> 
            Panel de control</a><br />            
            <?php echo( "<a href=" . $phpbb_url_path . 'ucp.php?mode=logout&redirect=../index.php' . '&sid=' . $user->data['session_id'] . " >Cerrar Sesion</a>");?>.</td> 
        </tr> 
      </table> 
      <table width="145" height="72" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> 
          <tr> 
            <td align="center" valign="top">0</td> 
          </tr> 
      </table></td> 
  </tr> 
</table> 



<?php 
} else { 
?> 
<table width="145" height="392" border="0" cellpadding="0" cellspacing="0"> 
  <tr> 
    <td width="145" align="center" valign="top"><p> 

        <form action="<?php echo $phpbb_url_path?>ucp.php?mode=login" target="_top" method="post" enctype="multipart/form-data">
          <img src="http://www.tudominio.com/avatar-default.jpg" alt="." width="135" height="250" /> Usuario: 
          <input name="username" type="text" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; WIDTH: 110px; BORDER-BOTTOM: 0px" value="" size="10" /> 
          <br /> 
          Contrase&ntilde;a:<br /> 
          <input type="password" name="password"  style="BORDER-RIGHT: 0px; BORDER-TOP: 0px;  BORDER-LEFT: 0px; WIDTH: 110px; BORDER-BOTTOM: 0px" size="10" maxlength="32"  > 
          <br /> 
          <input type="checkbox" name="autologin" id="autologin" class="checkbox" value="ON"  /> 
          Autologin 
          <input type="hidden" name="redirect" value="../index.php"> 

          <div><a href="<?php echo $phpbb_url_path?>ucp.php?mode=register" title="Léete las condiciones y decide si quieres pertenecer a esta comunidad." >Soy nuevo</a></div> 
          <div><a href="<?php echo $phpbb_url_path?>ucp.php?mode=sendpassword" title="Danos tu nombre de usuario y tu correo electr&oacute;nico y te mandamos una nueva" >Recordar password </a></div> 
          <input type="submit" value=" Entrar " name="login"  style="BORDER-RIGHT: 0px; BORDER-TOP: 0px;  BORDER-LEFT: 0px; WIDTH: 60px; BORDER-BOTTOM: 0px"> 

    </form></td> 
  </tr> 
</table> 




<?php } 

?>
Hay que tener en cuenta, que las primeras lineas son necesarias para que identifique al usuario en PHPBB, etc, pero que las ponga donde las ponga en Prestashop me tira error.


Lo que pretendo finalmente, es unir PHPBB + Prestashop, hacerlo por mi cuenta, y explicaros a todos como lo he logrado.

El funcionamiento sera el siguiente.

- Identificacion y registro a traves de Prestashop.
- Si te registras en Prestashop automaticamente en PHPBB
- Si te identificas en PRESTASHOP automaticamente lo haces en PHPBB para SIMULAR que solo existe un usuario.
- Solo se pueden modificar los datos del usuario a traves de PRESTASHOP
- Convivir sin problemas PRESTASHOP en PHPBB aunque solo sean las funciones de samrty, iniciode sesion, etc; para que aunque estes en el Foro mantengas tu carrito, etc.

¿Me podeis ayudar un poquillo entre todos?

PD: Para hacer todo mas facil, esta en la misma BBDD Prestashop y PHPBB

Este es el enlace a lo que pretendo hacer de una forma mas facil: http://www.forosdelweb.com/f121/inte...tashop-896525/

Muchas gracias por vuestra ayuda,

Saludos