Página 1 de 1

Problema Easy-Mod

Publicado: 05 Dic 2006, 15:59
por munkybass
Versión phpBB: 2.0.21
Mods: EasyMod
Url: http://ivflechas.exilia2.cl/foros/


Hola!
Talvez alguien vió mis posts para poder trasladar un foro Xenno a phpBB, finalmente lo logré 8)
Gracias al creador del conversor, llegue a una solución para recuperar la cuenta de administrador.
Pero el problema es que necesito instalar un mod para poder hacer "legibles" las contraseñas y los usuarios no tengan que re-activarlas de modo manual.

Instalé EasyMod, pero a la hora de instalar no encuentra el mod,
la ruta es:
foro/admin/mods/log_in [dentro está login.mod]

El mod en cuestión es este:

Código: Seleccionar todo

#
#-----[ OPEN ]------------------------------------------
#
login.php
#
#-----[ FIND ]------------------------------------------
#
$username = isset($HTTP_POST_VARS['username']) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';
      $password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : '';
#
#-----[ AFTER,ADD ]------------------------------------------
#
//*** start punnbb to phpbb password converter ***
//this extra bit of code checks if the pass is from punbb then
//updates the password to something phpbb would understand.  There
//are other ways to do this but i believe that this requires the least
//amount of editing (and understanding) of phpbbs original code. ;')

   $sql = "SELECT user_id, username, user_password   FROM " . USERS_TABLE . " WHERE username = '" . str_replace("\\'", "''", $username) . "'";
   if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Error in obtaining userdata', '', __LINE__, __FILE__, $sql); }
   
   //lets just make sure the user exists
   $count = $db->sql_numrows($result);
   if ( $count == 1 )
   {
      //users exists so lets grab their info
      if( $row = $db->sql_fetchrow($result) )
      {
         //if a sha1 encryption is equal to the pass in the database then its left over from punbb
         //also its only 32 chars long since they were truncated in the dump
         if ( substr( sha1( $HTTP_POST_VARS['password'] ), 0, 32) == substr( $row['user_password'], 0, 32) )
         {
            //take the subbed pass and put a md5 encryption on it and insert it into the database
            $sql = "UPDATE phpbb_users SET user_password = '" . md5( $HTTP_POST_VARS['password'] ) . "' WHERE user_id = '" . $row['user_id'] . "'";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Password Error:<br />Please contact your board administrator immediately.', '', __LINE__, __FILE__, $sql);
			}
         }
      }
   }

//we are updating the database password (if neccessary) before phpbb has a
//chance to check it.  the rest of the code should just run as if normally.
//coded by: sporkit @ www.sporkit.com  2005
//*** end punnbb to phpbb password converter ***
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM 




//*** start punnbb to phpbb password converter ***
//this extra bit of code checks if the pass is from punbb then
//updates the password to something phpbb would understand.  There
//are other ways to do this but i believe that this requires the least
//amount of editing (and understanding) of phpbbs original code. ;')

   $sql = "SELECT user_id, username, user_password   FROM " . USERS_TABLE . " WHERE username = '" . str_replace("\\'", "''", $username) . "'";
   if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Error in obtaining userdata', '', __LINE__, __FILE__, $sql); }
   
   //lets just make sure the user exists
   $count = $db->sql_numrows($result);
   if ( $count == 1 )
   {
      //users exists so lets grab their info
      if( $row = $db->sql_fetchrow($result) )
      {
         //if a sha1 encryption is equal to the pass in the database then its left over from punbb
         //also its only 32 chars long since they were truncated in the dump
         if ( substr( sha1( $HTTP_POST_VARS['password'] ), 0, 32) == substr( $row['user_password'], 0, 32) )
         {
            //take the subbed pass and put a md5 encryption on it and insert it into the database
            $sql = "UPDATE phpbb_users SET user_password = '" . md5( $HTTP_POST_VARS['password'] ) . "' WHERE user_id = '" . $row['user_id'] . "'";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Password Error:<br />Please contact your board administrator immediately.', '', __LINE__, __FILE__, $sql);
			}
         }
      }
   }

//we are updating the database password (if neccessary) before phpbb has a
//chance to check it.  the rest of the code should just run as if normally.
//coded by: sporkit @ www.sporkit.com  2005
//*** end punnbb to phpbb password converter ***
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM 
o alguna sugerencia para hacerlo de manera manual?
Ya que me complica el apartado SQL.

Respuesta: Problema Easy-Mod

Publicado: 05 Dic 2006, 16:33
por SuperNovato
Easy MOD no instala todos los MOD, sólo algunos.

Sobre cómo hacer consultas SQL tienes tanto temas en las FAQs (foro de Guías)
como un recurso en nuestras firmas
(aunque no veo bien dónde tienes que hacer una consulta SQL).

Sobre cómo instalar MOD, también hay una guía en las FAQs.

Y hay otra sobre cómo instalar Easy MOD.

Mi consejo es que te olvides de Easy MOD e instales los MOd de forma manual. Te ahorrarás líos.

Un saludo.