28-04-2009, 05:05 PM
|
#4 (permalink)
|
|
Amigo SE
Registrado em: Dec 2008
Localização: Nilópolis - RJ
Posts: 539
Agradecido 911 Vezes em 255 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
Meu Estado:
Nome Real: Hugo Alcovias Gomes Santos Pereira
|
<?php
include "cfg/config.php";
$L2JBS_config["mysql_host"]="$dbhost"; // MySQL IP
$L2JBS_config["mysql_port"]=3306; // MySQP port
$L2JBS_config["mysql_db"]="$dbname"; // l2jnet_db or your lineage 2 server database name
$L2JBS_config["mysql_login"]="$dbuser"; // MySQL Login name
$L2JBS_config["mysql_password"]="$dbpass"; // MySQL Password
error_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;
}
-->
</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("Preencher todos os campos do formularios ");
return false;
}
if (!isAlphaNumeric(f.account.value))
{
alert("Preencher todos os campos do formularios");
return false;
}
if (f.oldpassword.value=="")
{
alert("Você colocou sua senha antiga");
return false;
}
if (f.newpassword.value=="")
{
alert("Nenhuma senha detectada no campo");
return false;
}
if (!isAlphaNumeric(f.newpassword.value))
{
alert("44444");
return false;
}
if (f.newpassword2.value=="")
{
alert("Você não repetiu a senha");
return false;
}
if (f.newpassword.value!=f.newpassword2.value)
{
alert(" Senha não é igual! ");
return false;
}
return true;
}
//]]></script>
<link href="style.css" rel="stylesheet" type="text/css">
<title>Trocar Senha</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}
.style14 {
color: #000000;
font-family: Geneva, Arial, Helvetica, sans-serif;
}
.style15 {
color: #999999;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-weight: bold;
}
-->
</style>
<body>
<form method="post" action="" onSubmit="return checkform(this)">
<div align="center"><strong><span class="style14">Trocar senha</span></strong><font face="Verdana, Arial, Helvetica, sans-serif"><strong><span class="Estilo6"><br>
</span>
</strong></font> <br>
<table border="1" bordercolor="#CCCCCC" background="imagens/imagens/home_r6_c1.gif" bgcolor="#FFFFFF">
<tr>
<td class="Estilo1"><div align="left" class="style15"><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="style15"><font face="Trebuchet MS">Senha Atual </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="style15"><font face="Trebuchet MS">Nova Senha </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="style15"><font face="Trebuchet MS">Repetir Senha </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="Trocar SENHA" />
</b></font></td>
</tr>
</table>
</div>
</form>
<center>
<?php
if(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=black>Senha modificada. </font> </p>";
}
else
print "<p class=\"error\"><font size=1 color=black>Ouve algum erro, tente novamente. </font> </p>";
mysql_close($link);
}
}
else
{
echo "<font size=1 color=black>As limitações não foram testadas para a segurança. Se você for confiável que tido a informação correta, consultar por favor à administração.</font>";
}
?>
</center>
</body>
</html>
|
|
|