spamFiltr($_POST['name']) != '0' ||
$filter->spamFiltr($_POST['city']) != '0' ||
$filter->spamFiltr($_POST['city2']) != '0' ||
$filter->spamFiltr($_POST['homepage']) != '0' ||
$filter->spamFiltr($_POST['about']) != '0' ||
$filter->spamFiltr($_POST['hobby']) != '0'
) &&
$u->info['level'] < 9
) {
mysql_query(
'UPDATE `users` SET `info_delete` = "' . (time(
) + 86400) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
);
}
$_POST['city'] = htmlspecialchars($_POST['city'], null, 'cp1251');
$_POST['city2'] = htmlspecialchars($_POST['city2'], null, 'cp1251');
$_POST['icq'] = htmlspecialchars($_POST['icq'], null, 'cp1251');
if (!isset($_POST['mat'])) {
$_POST['mat'] = null;
}
if (!isset($_POST['hide_icq'])) {
$_POST['hide_icq'] = null;
}
$_POST['skype'] = htmlspecialchars($_POST['skype'], null, 'cp1251');
if (!isset($_POST['hide_skype'])) {
$_POST['hide_skype'] = null;
} else {
$_POST['hide_skype'] = 1;
}
$_POST['hide_icq'] = htmlspecialchars($_POST['hide_icq'], null, 'cp1251');
$_POST['homepage'] = htmlspecialchars($_POST['homepage'], null, 'cp1251');
$_POST['about'] = htmlspecialchars($_POST['about'], null, 'cp1251');
if ($u->info['admin'] == 0) {
$_POST['hobby'] = htmlspecialchars($_POST['hobby'], null, 'cp1251');
}
$_POST['ChatColor'] = htmlspecialchars($_POST['ChatColor'], null, 'cp1251');
$_POST['hobby'] = str_replace("\\n", "
", $_POST['hobby']);
$_POST['hobby'] = str_replace("\\r", "", $_POST['hobby']);
$_POST['hobby'] = str_replace("<BR>", "
", $_POST['hobby']);
$simbolcount = strlen($_POST['hobby']);
if (isset($_POST['ChatColor']) && $u->info['admin'] == '0' && !($_POST['ChatColor'] == "Black" || $_POST['ChatColor'] == "Blue" || $_POST['ChatColor'] == "Lilac" || $_POST['ChatColor'] == "Fuchsia" || $_POST['ChatColor'] == "Gray" || $_POST['ChatColor'] == "Green" || $_POST['ChatColor'] == "Maroon" || $_POST['ChatColor'] == "Navy" || $_POST['ChatColor'] == "Olive" || $_POST['ChatColor'] == "Purple" || $_POST['ChatColor'] == "Teal" || $_POST['ChatColor'] == "Orange" || $_POST['ChatColor'] == "Chocolate" || $_POST['ChatColor'] == "DarkKhaki" || $_POST['ChatColor'] == "SandyBrown")) {
echo "
Возможно использовать цвета указанные только в меню анкеты !
";
$_POST['ChatColor'] = "Black";
}
if (!$_POST['city']) {
$city = $_POST['city2'];
} elseif ($_POST['city'] && $_POST['city2']) {
$city = $_POST['city2'];
} else {
$city = $_POST['city'];
}
}
if (isset($_POST['saveanketa'])) {
if ($u->info['level'] <= 1) {
$dt = explode('.', $_POST['0day']);
if (isset($dt[0], $dt[1], $dt[2])) {
$erd = 0;
$dt[0] = round($dt[0]);
$dt[1] = round($dt[1]);
$dt[2] = round($dt[2]);
if ($dt[0] < 1 || $dt[0] > 31) {
$erd = 1;
}
if ($dt[1] < 1 || $dt[1] > 12) {
$erd = 2;
}
if ($dt[2] < 1920 || $dt[2] > 2006) {
$erd = 3;
}
if ($erd == 0) {
$_POST['0day'] = $dt[0] . '.' . $dt[1] . '.' . $dt[2];
$dateofbirth = "`bithday` = '" . mysql_real_escape_string($_POST['0day']) . "',";
}
}
$u->info['bithday'] = $_POST['0day'];
}
$st = $u->lookStats($u->info['stats']);
$maxsimbols = 2000 + ($st['os6'] * 200);
if ($_POST['mat'] == 1) {
$_POST['mat'] = 1;
} else {
$_POST['mat'] = 0;
}
if ($simbolcount <= $maxsimbols || $u->info['admin'] != 0) {
$lastdes = $u->info['design'];
if ($_POST['design'] == 1) {
$u->info['design'] = 1;
} else {
$u->info['design'] = 0;
}
}
if ($simbolcount > $maxsimbols && $u->info['admin'] == 0) {
echo 'Максимальный размер поля "Увлечения / хобби" - ' . $maxsimbols . ' символов.
';
} elseif (mysql_query(
"UPDATE
`users`
SET
`design` = '" . $u->info['design'] . "',
`name` = '" . mysql_real_escape_string($_POST['name']) . "',
`city_real` = '" . mysql_real_escape_string($_POST['city2']) . "',
`icq` = '" . mysql_real_escape_string((int)$_POST['icq']) . "',
`icq_hide` = '" . mysql_real_escape_string($_POST['hide_icq']) . "',
`skype` = '" . mysql_real_escape_string($_POST['skype']) . "',
`skype_hide` = '" . mysql_real_escape_string($_POST['hide_skype']) . "',
`homepage` = '" . mysql_real_escape_string($_POST['homepage']) . "',
" . $dateofbirth . "
`deviz` = '" . mysql_real_escape_string($_POST['about']) . "',
`hobby` = '" . mysql_real_escape_string($_POST['hobby']) . "',
`chatColor` = '" . mysql_real_escape_string($_POST['ChatColor']) . "',
`mat` = '" . mysql_real_escape_string((int)$_POST['mat']) . "'
WHERE
`id` = '" . mysql_real_escape_string($u->info['id']) . "' LIMIT 1;"
)) {
echo 'Сохранено
';
if ($u->info['design'] != $lastdes) {
echo '';
}
$u->info['name'] = $_POST['name'];
$u->info['city_real'] = $city;
$u->info['icq'] = $_POST['icq'];
$u->info['icq_hide'] = $_POST['hide_icq'];
$u->info['skype'] = $_POST['skype'];
$u->info['skype_hide'] = $_POST['hide_skype'];
$u->info['homepage'] = $_POST['homepage'];
$u->info['deviz'] = $_POST['about'];
$u->info['hobby'] = $_POST['hobby'];
$u->info['chatColor'] = $_POST['ChatColor'];
$u->info['mat'] = $_POST['mat'];
} else {
echo 'что-то не так...';
}
}
?>
info['pass']) {
if ($_POST['pass_new'] == $_POST['pass_new2']) {
$u->info['pass'] = md5($_POST['pass_new']);
mysql_query(
'UPDATE `users` SET `pass` = "' . $u->info['pass'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
);
//
setcookie('login', $u->info['login'], time() + 86400 * 365, '', $c['host']);
setcookie('pass', $u->info['pass'], time() + 86400 * 365, '', $c['host']);
//
echo 'Новый пароль успешно записан!
';
} else {
echo 'Новый пароль не сповпадает со вторым полем!
';
}
} else {
echo 'Неверный текущий пароль, попробуйте снова!
';
}
}
?>