Files
ventas_php/templates/forms/editar-usuario.tpl
nickpons666 448a2aa240 feat(security): Implementar sistema de contraseñas seguro con hashing
- Añadir hashing bcrypt para todas las contraseñas nuevas y existentes
- Implementar verificación segura con password_hash() y password_verify()
- Migrar 10 contraseñas existentes de texto plano a formato hash
- Agregar protección CSRF en formulario de login
- Implementar rate limiting (5 intentos/minuto) contra fuerza bruta
- Mejorar formulario de edición con campos de contraseña seguros
- Agregar validación de coincidencia y longitud mínima de contraseñas
- Sanitización de inputs y validación de formato de email
- Prevenir exposición de hashes en interfaz de usuario

Cambia vulnerabilidad crítica donde las contraseñas se almacenaban y viajaban en texto plano.
2026-01-09 15:24:26 -06:00

183 lines
8.5 KiB
Smarty
Executable File

<div id="divForm">
<form id="editarUsuarioForm" name="editarUsuarioForm" method="post" enctype="multipart/form-data">
<input type="hidden" id="usuarioId" name="usuarioId" value="{$info.usuarioId}" />
<input type="hidden" id="type" name="type" value="saveEditUsuario" />
<fieldset>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="130" height="40">* Tipo:</td>
<td>{include file="{$DOC_ROOT}/templates/lists/enumUserTypes.tpl"}</td>
<td width="10"></td>
<td width="130"><div id="txtSuc" {if $info.type == "supervisor"}style="display:none"{/if}>Sucursal:</div></td>
<td>
<div id="listSuc" {if $info.type == "supervisor"}style="display:none"{/if}>
<select name="sucursalId" id="sucursalId" class="largeInput" style="width:300px">
<option value="">Seleccione</option>
{foreach from=$sucursales item=item key=key}
<option value="{$item.sucursalId}" {if $info.sucursalId == $item.sucursalId}selected{/if}>{$item.nombre}</option>
{/foreach}
</select>
</div>
</td>
</tr>
<tr>
<td height="40">* Nombre:</td>
<td><input name="nombre" id="nombre" type="text" class="largeInput" style="width:290px" value="{$info.nombre}"/></td>
<td width="10"></td>
<td>Apellidos:</td>
<td><input name="apellidos" id="apellidos" type="text" class="largeInput" style="width:290px" value="{$info.apellidos}"/></td>
</tr>
<tr>
<td height="40">Direcci&oacute;n:</td>
<td><input name="calle" id="calle" type="text" class="largeInput" style="width:290px" value="{$info.calle}"/></td>
<td width="10"></td>
<td>No Exterior:</td>
<td><input name="noExt" id="noExt" type="text" class="largeInput" style="width:290px" value="{$info.noExt}"/></td>
</tr>
<tr>
<td height="40">No Interior:</td>
<td><input name="noInt" id="noInt" type="text" class="largeInput" style="width:290px" value="{$info.noInt}"/></td>
<td width="10"></td>
<td>Referencia:</td>
<td><input name="referencia" id="referencia" type="text" class="largeInput" style="width:290px" value="{$info.referencia}"/></td>
</tr>
<tr>
<td height="40">Colonia:</td>
<td><input name="colonia" id="colonia" type="text" class="largeInput" style="width:290px" value="{$info.colonia}"/></td>
<td width="10"></td>
<td>Localidad:</td>
<td><input name="localidad" id="localidad" type="text" class="largeInput" style="width:290px" value="{$info.localidad}"/></td>
</tr>
<tr>
<td height="40">Municipio o Delegaci&oacute;n:</td>
<td><input name="municipio" id="municipio" type="text" class="largeInput" style="width:290px" value="{$info.municipio}"/></td>
<td width="10"></td>
<td>Estado:</td>
<td><input name="estado" id="estado" type="text" class="largeInput" style="width:290px" value="{$info.estado}"/></td>
</tr>
<tr>
<td height="40">Pais:</td>
<td><input name="pais" id="pais" type="text" class="largeInput" style="width:290px" value="{$info.pais}"/></td>
<td width="10"></td>
<td>C&oacute;digo Postal:</td>
<td><input name="codigoPostal" id="codigoPostal" type="text" class="largeInput" style="width:290px" value="{$info.codigoPostal}"/></td>
</tr>
<tr>
<td height="40">Tel&eacute;fono:</td>
<td><input name="telefono" id="telefono" type="text" class="largeInput" style="width:290px" value="{$info.telefono}"/></td>
<td width="10"></td>
<td>Celular:</td>
<td><input name="celular" id="celular" type="text" class="largeInput" style="width:290px" value="{$info.celular}"/></td>
</tr>
<tr>
<td height="40">No. IMSS:</td>
<td><input name="noImss" id="noImss" type="text" class="largeInput" style="width:290px" value="{$info.noImss}"/></td>
<td width="10"></td>
<td>CURP:</td>
<td><input name="curp" id="curp" type="text" class="largeInput" style="width:290px" value="{$info.curp}"/></td>
</tr>
<tr>
<td height="40">RFC:</td>
<td><input name="rfc" id="rfc" type="text" class="largeInput" style="width:290px" value="{$info.rfc}"/></td>
<td width="10"></td>
<td>Email:</td>
<td><input name="email" id="email" type="text" class="largeInput" style="width:290px" value="{$info.email}"/></td>
</tr>
<tr>
<td height="40">Nueva Contrase&ntilde;a:</td>
<td>
<input name="password" id="password" type="password" class="largeInput" style="width:290px" placeholder="Dejar en blanco para no cambiar"/>
<br><small>Si no desea cambiar la contraseña, deje este campo vacío.</small>
</td>
<td width="10"></td>
<td>Confirmar:</td>
<td><input name="password_confirm" id="password_confirm" type="password" class="largeInput" style="width:290px" placeholder="Confirmar nueva contraseña"/></td>
</tr>
<tr>
<td colspan="5" align="center" height="50"><b>.:: IDENTIFICACION OFICIAL ::.</b></td>
</tr>
<tr>
<td colspan="5" align="center">
{if $info.identificacion != ""}
<a href="{$WEB_ROOT}/images/identificacion/{$info.identificacion}" target="_blank">
<img src="{$WEB_ROOT}/images/identificacion/{$info.identificacion}" width="100" height="100" border="0" />
</a>
<br />
<input type="checkbox" name="delIdentificacion" id="delIdentificacion" value="1" />Eliminar imagen
<br />&nbsp;
{/if}
</td>
</tr>
<tr>
<td colspan="5" align="center"><input type="file" name="identificacion" id="identificacion" /></td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
</tr>
<tr>
<td colspan="5" align="center" height="50"><b>.:: COMPROBANTE DE DOMICILIO ::.</b></td>
</tr>
<tr>
<td colspan="5" align="center">
{if $info.comprobante != ""}}
<a href="{$WEB_ROOT}/images/comprobante/{$info.comprobante}" target="_blank">
<img src="{$WEB_ROOT}/images/comprobante/{$info.comprobante}" width="100" height="100" border="0" />
</a>
<br />
<input type="checkbox" name="delComprobante" id="delComprobante" value="1" />Eliminar imagen
<br />&nbsp;
{/if}
</td>
</tr>
<tr>
<td colspan="5" align="center"><input type="file" name="comprobante" id="comprobante" /></td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
</tr>
</table>
<div align="center" id="sucSup" {if $info.type != "supervisor"}style="display:none"{/if}>
<table width="30%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" colspan="2"><b>.:: SUCURSALES A SUPERVISAR ::.</b></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
{foreach from=$sucursales item=item key=key}
<tr>
<td align="center"><input type="checkbox" name="idSuc[]" value="{$item.sucursalId}" {if $item.checked}checked{/if} /></td>
<td align="left">{$item.nombre}</td>
</tr>
{/foreach}
</table>
</div>
<div class="formLine">
<hr />
* Campos requeridos
</div>
</fieldset>
</form>
<div align="center" style="display:none" id="loader">
<img src="{$WEB_ROOT}/images/loading.gif">
<br>
Guardando Informaci&oacute;n...
<br />Este proceso puede tardar unos segundos.
<br />&nbsp;
</div>
<div style="clear:both"></div>
<div style="margin-left:415px">
<a class="button" name="btnSave" onclick="EditUsuario()"><span>Guardar</span></a>
</div>
<div style="clear:both"></div>
<br /><br />
<div style="margin-left:410px"><a href="{$WEB_ROOT}/usuarios"><< Regresar</a></div>
</div>