Página 1 de 1

Solucion al Problema de cambio de pass en administracion

Publicado: 11 Feb 2006, 18:56
por Nazcar
Bien los usuarios de Firefox seguro que sben que tenemos un problema a la hora de editr usuarios o grupos en el ACP ya que el firefox automaticamente cambia el password por el nuestro,pues bien aqui dejo la manera de arreglarlo

Extraido de phpbb.com

Código: Seleccionar todo

##############################################################
## MOD Title: Fix For The Firefox "Remember Passwords" Problem
## MOD Author: T0ny < N/A > (Tony Smith) N/A
## MOD Description: Fix for firefox's Remember Passwords feature
##					overwriting username and password on the 
##					'User Administration' page
## MOD Version: 1.0.2
##
## Installation Level: Easy
## Installation Time: ~5 Minutes
## Files To Edit: 5
## 					admin/admin_ug_auth.php
## 					admin/admin_users.php
## 					templates/subSilver/admin/user_edit_body.tpl
## 					templates/subSilver/admin/user_select_body.tpl
##					templates/subSilver/search_username.tpl
## Included Files: N/A
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##			Simply renames the 'username' field to
##			'user_name' and changes all relevant occurrences of
##			$HTTP_POST_VARS['username'] to $HTTP_POST_VARS['user_name']
##
##			Tested with phpbb v2.0.19 , Firefox 1.5 , IE 6.0SP2
##
##############################################################
## MOD History:
##
##   2006-01-29 - Version 1.0.0
##      - initial release
##
##   2006-02-05 - version 1.0.1
##      - fixed incorrect case in references to subSilver template
##      - fixed bug causing 'Find A Username' to not work (search_username.tpl)
##
##	2006-02-08 - version 1.0.2
##		- fixed faulty find/replace actions
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#

admin/admin_users.php

#
#-----[ FIND ]---------------------------------------------------
#

if ( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username']) || isset($HTTP_GET_VARS[POST_USERS_URL]) || isset( $HTTP_POST_VARS[POST_USERS_URL]) ) )

#
#-----[ REPLACE WITH ]---------------------------------------------------
#

if ( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['user_name']) || isset($HTTP_GET_VARS[POST_USERS_URL]) || isset( $HTTP_POST_VARS[POST_USERS_URL]) ) )

#
#-----[ FIND ]---------------------------------------------------
#

$username = ( !empty($HTTP_POST_VARS['username']) ) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';

#
#-----[ REPLACE WITH ]---------------------------------------------------
#

$username = ( !empty($HTTP_POST_VARS['user_name']) ) ? phpbb_clean_username($HTTP_POST_VARS['user_name']) : '';

#
#-----[ FIND ]---------------------------------------------------
#

$this_userdata = get_userdata($HTTP_POST_VARS['username'], true);

#
#-----[ REPLACE WITH ]---------------------------------------------------
#

$this_userdata = get_userdata($HTTP_POST_VARS['user_name'], true);

#
#-----[ FIND ]---------------------------------------------------
#

$s_hidden_fields .= '<input type="hidden" name="username" value="' . str_replace("\"", """, $username) . '" />';

#
#-----[ REPLACE WITH ]---------------------------------------------------
#

$s_hidden_fields .= '<input type="hidden" name="user_name" value="' . str_replace("\"", """, $username) . '" />';

#
#-----[ OPEN ]------------------------------------------
#

admin/admin_ug_auth.php

#
#-----[ FIND ]---------------------------------------------------
#

else if ( ( $mode == 'user' && ( isset($HTTP_POST_VARS['username']) || $user_id ) ) || ( $mode == 'group' && $group_id ) )

#
#-----[ REPLACE WITH ]---------------------------------------------------
#

else if ( ( $mode == 'user' && ( isset($HTTP_POST_VARS['user_name']) || $user_id ) ) || ( $mode == 'group' && $group_id ) )

#
#-----[ FIND ]---------------------------------------------------
#

if ( isset($HTTP_POST_VARS['username']) )

#
#-----[ REPLACE WITH ]---------------------------------------------------
#

if ( isset($HTTP_POST_VARS['user_name']) )

#
#-----[ FIND ]---------------------------------------------------
#

$this_userdata = get_userdata($HTTP_POST_VARS['username'], true);

#
#-----[ REPLACE WITH ]---------------------------------------------------
#

$this_userdata = get_userdata($HTTP_POST_VARS['user_name'], true);

#
#-----[ OPEN ]------------------------------------------
#

templates/subSilver/admin/user_edit_body.tpl

#
#-----[ FIND ]---------------------------------------------------
#

<input class="post" type="text" name="username" size="35" maxlength="40" value="{USERNAME}" />

#
#-----[ REPLACE WITH ]---------------------------------------------------
#

<input class="post" type="text" name="user_name" size="35" maxlength="40" value="{USERNAME}" />

#
#-----[ OPEN ]------------------------------------------
#

templates/subSilver/admin/user_select_body.tpl

#
#-----[ FIND ]---------------------------------------------------
#

<td class="row1" align="center"><input type="text" class="post" name="username" maxlength="50" size="20" /> <input type="hidden" name="mode" value="edit" />{S_HIDDEN_FIELDS}<input type="submit" name="submituser" value="{L_LOOK_UP}" class="mainoption" /> <input type="submit" name="usersubmit" value="{L_FIND_USERNAME}" class="liteoption" onClick="window.open('{U_SEARCH_USER}', '_phpbbsearch', 'HEIGHT=250,resizable=yes,WIDTH=400');return false;" /></td>

#
#-----[ REPLACE WITH ]---------------------------------------------------
#

<td class="row1" align="center"><input type="text" class="post" name="user_name" maxlength="50" size="20" /> <input type="hidden" name="mode" value="edit" />{S_HIDDEN_FIELDS}<input type="submit" name="submituser" value="{L_LOOK_UP}" class="mainoption" /> <input type="submit" name="usersubmit" value="{L_FIND_USERNAME}" class="liteoption" onClick="window.open('{U_SEARCH_USER}', '_phpbbsearch', 'HEIGHT=250,resizable=yes,WIDTH=400');return false;" /></td>

#
#-----[ OPEN ]------------------------------------------
#

templates/subSilver/search_username.tpl

#
#-----[ FIND ]---------------------------------------------------
#

opener.document.forms['post'].username.value = selected_username;

#
#-----[ REPLACE WITH ]---------------------------------------------------
#

if (opener.document.forms['post'].user_name)
{
	opener.document.forms['post'].user_name.value = selected_username;
}
else
{
	opener.document.forms['post'].username.value = selected_username;
}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM



Un Saludo

Respuesta: Solucion al Problema de cambio de pass en adminis

Publicado: 12 Feb 2006, 03:23
por mitch
gracias Nazcar, muy í?ºtil, eso, lo instalarí?© en cuanto pueda :D

Respuesta: Solucion al Problema de cambio de pass en adminis

Publicado: 12 Feb 2006, 03:26
por Nazcar
Ya te digo,yo andaba ya loco abriendo la edicion de usuarios con el IE por que a la que me despistaba el firefox me cambiaba el pass


Un saludo

Respuesta: Solucion al Problema de cambio de pass en adminis

Publicado: 12 Feb 2006, 10:19
por ThE KuKa
Gracias Nazcar

Respuesta: Solucion al Problema de cambio de pass en adminis

Publicado: 12 Feb 2006, 11:35
por JANU1535
Kuka a FAQ's o Guí?­as ??
;)
Buen trabajo nazcar

Respuesta: Solucion al Problema de cambio de pass en adminis

Publicado: 12 Feb 2006, 23:17
por viktor
Muy bueno, la verdad que encontrar un FAQ en phpBB entre esa sopa de guias y MODs es todo un merito xD