Файл: user/info/email.php
Строк: 51
<?
include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/shif.php';
include_once '../../sys/inc/user.php';
only_reg();
$set['title']='Безопасность';
include_once '../../sys/inc/thead.php';
title();
echo '<div class="ot4">'.$title.'</div>';
if(isset($_POST['ok'])){
$mail = $_POST['mail'];
$lospass = $_POST['lospass'];
if(empty($mail) || empty($lospass)){
$err = 'Все поля обязательны к заполнению!';
}
if(!preg_match("/@/i",$_POST['mail']))
{
$err = 'Неверный формат E-mail';
}
if(md5($lospass) != $users['pass']){
$err = 'Не верно введен текущий пароль!';
}
/*
if($newpass != $newpass2){
$err = 'Новый пароль не совпадает с подтвержденным паролем!';
}
*/
if(empty($err)){
core::$dbs->query("UPDATE `users` SET `mail` = ? WHERE `id` = ? LIMIT 1",array($mail, $user['id']));
msg('Данные успешно изменены!');
} else {
err($err);
}
}
echo '<div class="block"><form action="?" method="post">Текущий пароль:<br /><input type="text" name="lospass" style="width:98%; height: 40px"/><br />Ваш E-mail:<br /><input type="text" name="mail" style="width:98%; height: 40px" value="'.$user['mail'].'"/><br /><br /><input type="submit" name="ok" value="Сменить" style="width:99%; height: 40px"/></form></div>';
include_once '../../sys/inc/tfoot.php';
?>