Recordad que para pedir soporte alguno, debéis facilitar los datos de soporte oportunos por favor, mirad aquí y leer las Normas generales del foro, esto nos servirá de ayuda para dar el mejor soporte..

Gracias.

La Administración de phpBB España.

Problema Easy-Mod

Aquí­ podrás dejar tus dudas sobre MODs o MODificaciones de tu phpBB2
  Reglas del Foro
Antes de participar en los foros, leer esto por favor.
Normas generales de phpBB-Es y las de Soporte
Cerrado

0
No hay votos
 
Votos totales: 0

Avatar de Usuario
munkybass
Observador/a
Mensajes: 9
Registrado: 04 Dic 2006, 14:38

Problema Easy-Mod

#1

Mensaje 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.

SuperNovato
Ex Staff
Mensajes: 2521
Registrado: 15 Mar 2006, 19:34

Respuesta: Problema Easy-Mod

#2

Mensaje 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.
Yo no sé casi nada de esto. Pero puedo aprender.
Porque para saber estoy solo. Pero para aprender no.

[hr]Antes de nada, lee las Normas de phpBB-Es, y la siempre útil Guí­a de phpBB en Castellano.
Consulta la Biblioteca (Guías, etc.), y los FAQS de ayuda phpBB para tus problemas. Quizás esté resuelto.
Si es sobre cómo Crear una Consulta SQL ya lo tienes explicado en el enlace.
En general, se pide Buscar antes de preguntar para no repetir preguntas y dudas resueltas.
Sólo tendrás Soporte si facilitas los datos correspondientes y si respetas completamente el Copyright de phpBB.
NOTA: No damos Soporte a los foros integrados en Nuke y derivados del mismo. Infórmate [url=PHP-nuke-y-phpbb-vt1733.html]AQUÍ

Cerrado

Volver a “Soporte, preguntas sobre MODs de phpBB 2”