Файл: sumergame.ru/repass.php
Строк: 36
<?
define('PROTECTOR', 1);
$headmod = 'pers';//фикс. места
$textl='Смена пароля';
include('files/path.php');
include('files/gzips.php');
include($path.'files/db.php');
include($path.'files/auth.php');
include($path.'files/func.php');
include($path.'files/core.php');
include($path.'files/head.php');
include($path.'files/zag.php');
if (empty($_POST['submit'])) {
echo '<form action="repass.php" method="post">';
echo"Старый пароль:<br/>
<input class='input' type="text" size="10" maxlength="20" name="old"/><br/>";
echo"Новый пароль:<br/>
<input class='input' type="text" size="10" maxlength="20" name="new"/><br/>";
echo '<input type="submit" name="submit" value="готово"/></form>';
}else{
$old = md5($_POST['old']);
$new = htmlspecialchars($_POST['new']);
$new = md5($_POST['new']);
$error = false;
if ($old!=$udata['pass'])
$error = $error . 'Старый пароль неверен!<br/>';
if($_POST['new'] == "")
$error = $error . 'Вы оставили пустое поле: Новый пароль!<br/>';
if (ereg_replace("[A-za-z0-9]+", "", $_POST['new']))
$error = $error . 'Запрещёные символы в новом пароле!<br/>';
if (empty($error)) {
mysql_query("UPDATE
`users` SET
`pass` = '$new' WHERE `usr`='$log'");
if (isset ($_COOKIE['id']) && isset ($_COOKIE['pas'])) {
$cpas = $new;
setcookie("pas", $cpas, time() + 3600 * 24 * 365);
}
$_SESSION['pas'] = $new;
echo'Вы успешно сменили пароль!<br/>';
}else{
echo'<b>Ошибка:</b><br/>';
echo"$error";
}
}
include($path.'files/down.php');
include($path.'files/meny.php');
?>