Password Change

Iniciado por Swarlog, Jun 13, 2025, 11:50 PM

Tema anterior - Siguiente tema

Swarlog

<?php$L2JBS_config["mysql_host"]="localhost";	// MySQL IP$L2JBS_config["mysql_port"]=3306;		// MySQP port$L2JBS_config["mysql_db"]="l2jdb";		// l2jnet_db or your lineage 2 server database name$L2JBS_config["mysql_login"]="root";		// MySQL Login name	$L2JBS_config["mysql_password"]="root";		// MySQL Passworderror_reporting(0);?>

<?php$L2JBS_config["javascript_sort_method"]="bubble";$link = mysql_connect($L2JBS_config['mysql_host'].":".$L2JBS_config['mysql_port'], $L2JBS_config['mysql_login'], $L2JBS_config['mysql_password']);if (!$link)die("Couldn't connect to MySQL");@mysql_select_db($L2JBS_config['mysql_db'], $link)or die ('Error '.mysql_errno().': '.mysql_error());?>
<style type="text/css">
<!--
body {
background-image: url(imagens/index_r14_c3.gif);
}
a:link {
color: #FF9900;
font-weight: bold;
text-decoration: none;
}
a:visited {
color: #CCCCCC;
text-decoration: none;
}
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #FFFFFF;
}
a:hover {
color: #FF9933;
text-decoration: none;
}
a:active {
color: #FF6600;
text-decoration: none;
}
.style12 {
color: #FFFFFF;
font-size: 36px;
}
-->
</style>
<script type="text/javascript">//<![CDATA[
function isAlphaNumeric(value)
{
if (value.match(/^[a-zA-Z0-9]+$/))
return true;
else
return false;
}
function checkform(f)
{
if (f.account.value=="")
{
alert("Fill in all the fields ");
return false;
}
if (!isAlphaNumeric(f.account.value))
{
alert("Fill in all the fields");
return false;
}
if (f.oldpassword.value=="")
{
alert("You put in your old password in your new");
return false;
}
if (f.newpassword.value=="")
{
alert("No password detected");
return false;
}
if (!isAlphaNumeric(f.newpassword.value))
{
alert("44444");
return false;
}
if (f.newpassword2.value=="")
{
alert("You did not repeat the new password");
return false;
}
if (f.newpassword.value!=f.newpassword2.value)
{
alert(" Passwords do not match! ");
return false;
}
return true;
}
//]]></script>
<link href="style.css" rel="stylesheet" type="text/css">
<title>Password Change</title></head>
<style type="text/css">
<!--
.Estilo1 {
color: #FFFFFF;
font-family: "Courier New", Courier, monospace;
}
color: #FFFFFF;
font-weight: bold;
}
-->
.Estilo4 {font-size: 10px; font-weight: bold; }
.Estilo6 {color: #FFFFFF}
-->
</style>
<body>
<form method="post" action="?ir=lembrarsenha" onsubmit="return checkform(this)">
<center>
<font face="Verdana, Arial, Helvetica, sans-serif"><strong><span class="Estilo1">Change </span><span class="Estilo6">password<br>
</span><font color="#FF0000" size="4">
</font></strong></font> <br>
<table background="imagens/imagens/home_r6_c1.gif">
<tr>
<td class="Estilo1"><div align="left" class="Estilo4"><font face="Trebuchet MS">Login </font></div></td>
<td>
<font size="1"><b>
<input name="account" type="text" class="camp1" style="font-family: Trebuchet MS; " size="20" maxlength="15" />
</b></font></td>
</tr>
<tr>
<td class="Estilo1"><div align="left" class="Estilo4"><font face="Trebuchet MS">Old password </font></div></td>
<td><font size="1"><b>
<input name="oldpassword" type="password" class="camp1" style="font-family: Trebuchet MS; " size="20" maxlength="15" />
</b></font></td>
</tr>
<tr>
<td class="Estilo1"><div align="left" class="Estilo4"><font face="Trebuchet MS">New password </font></div></td>
<td><font size="1"><b>
<input name="newpassword" type="password" class="camp1" style="font-family: Trebuchet MS; " size="20" maxlength="15" />
</b></font></td>
</tr>
<tr>
<td class="Estilo1"><div align="left" class="Estilo4"><font face="Trebuchet MS">Repeat password </font> </div></td>
<td><font size="1"><b>
<input name="newpassword2" type="password" class="camp1" style="font-family: Trebuchet MS; " size="20" maxlength="15" />
</b></font></td>
</tr>
<tr>
<td colspan="2" style="text-align: center;"><font size="1"><b>
<input name="submit" type="submit" class="camp1" style="font-family: Trebuchet MS" value="Change password" />
</b></font></td>
</tr>
</table>
</center>
</form>
<center>
<?phpif(ereg("^([a-zA-Z0-9_-])*$", $_POST['account']) && ereg("^([a-zA-Z0-9_-])*$", $_POST['oldpassword']) && ereg("^([a-zA-Z0-9_-])*$", $_POST['newpassword']) && ereg("^([a-zA-Z0-9_-])*$", $_POST['newpassword2'])){	if ($page='index.php' && $_POST['account'] && strlen($_POST['account'])<16 && $_POST['oldpassword'] && $_POST['newpassword'] && $_POST['newpassword']==$_POST['newpassword2'])	{	$result=mysql_query("SELECT login,password FROM accounts WHERE login='".@mysql_real_escape_string($_POST['account'])."' AND password='".base64_encode(pack('H*', sha1($_POST['oldpassword'])))."'", $link)	 or die ("Error: ".mysql_error());	if (mysql_num_rows($result))	{	mysql_query("UPDATE accounts SET password='".base64_encode(pack('H*', sha1($_POST['newpassword'])))."' WHERE login='".mysql_real_escape_string($_POST['account'])."'", $link)	or die ("Error: ".mysql_error());	 print "<p style=\"font-weight: bold;\"><font size=1 color=ffffff>Password successfully changed. </font> </p>";	}	else	 print "<p class=\"error\"><font size=1 color=ffffff>There was an error, try again. </font> </p>";	mysql_close($link);	}}else{	echo "<font size=1 color=ffffff>Limitations have not been tested for safety. If you are confident that had the correct information, please refer to the administration.</font>";}?>

</center>
</body>
</html>