Файл: user/mail/settings.php
Строк: 109
<?php
include_once '../../sys/inc/start.php';
include_once H . 'sys/inc/compress.php';
include_once H . 'sys/inc/sess.php';
include_once H . 'sys/inc/settings.php';
include_once H . 'sys/inc/db_connect.php';
include_once H . 'sys/inc/ipua.php';
include_once H . 'sys/inc/fnc.php';
include_once H . 'sys/inc/user.php';
user::only_reg();
$config = array('domain' => @$set['mail_panel_domain'], 'aliase' => explode("n", @$set['mail_panel_aliase']),);
$user_set = mysql_fetch_assoc(mysql_query("SELECT * FROM `user_set` AS u WHERE `id_user` = '" . $user['id'] . "' LIMIT 1"));
if (!$user_set) {
mysql_query("INSERT INTO `user_set`(`id_user`) VALUES ('$user[id]')");
header('Location: ?');
exit;
}
if (isset($_POST['save'])) {
$user_set['privat_mail'] = (preg_match('/([0-2])/i', $_POST['privat_mail']) ? (int) $_POST['privat_mail'] : 1);
$user_set['email_spam'] = (isset($_POST['email_spam']) ? 1 : 0);
$user_set['email_on'] = (isset($_POST['email_on']) ? 1 : 0);
mysql_query("UPDATE `user_set` SET `privat_mail` = '$user_set[privat_mail]', `email_spam` = '$user_set[email_spam]', `email_on` = '$user_set[email_on]' WHERE `id_user` = '$user[id]' LIMIT 1");
msg('Настройки успешно сохранены');
header('Location: ?');
exit;
}
$set['title'] = 'Настройки почты/Настройки/' . stripcslashes(htmlspecialchars($user['nick']));
include_once H . 'sys/inc/thead.php';
aut();
echo "<link rel='stylesheet' href='/style/css/email.css' type='text/css' />";
echo "<ol class='breadcrumb'>";
echo "<li><a href='/'><span class='fa fa-home'></span></a></li>";
echo "<li><a href='/info.php?id=$user[id]'>$user[nick]</a></li>";
echo "<li><a href='/user/settings.php'>Настройки</a></li>";
echo "<li class='active'>Настройки почты</li>";
echo "</ol>";
if ($config['aliase']) {
echo "<div class='list-group-item'>";
echo "Ваши адреса электронной почты:<br />";
foreach ($config['aliase'] AS $key => $value) {
echo strtolower($user['nick']) . "@ $value<br />";
}
echo "</div>";
}
?>
<form class="list-group-item" action="?" method="POST">
<b>Принимать почту</b><br />
<label class='c-input c-radio'><input type="radio" name="privat_mail" value="1" <?= ($user_set['privat_mail'] == 1 ? 'checked' : '') ?>><span class='c-indicator'></span> <span class='fa fa-globe fa-fw'></span> От всех</label><br />
<label class='c-input c-radio'><input type="radio" name="privat_mail" value="2" <?= ($user_set['privat_mail'] == 2 ? 'checked' : '') ?>><span class='c-indicator'></span> <span class='fa fa-users fa-fw'></span> Только от друзей</label><br />
<label class='c-input c-radio'><input type="radio" name="privat_mail" value="0" <?= ($user_set['privat_mail'] == 0 ? 'checked' : '') ?>><span class='c-indicator'></span> <span class='fa fa-ban fa-fw'></span> Не принимать</label><br />
<b>Дополнительно</b><br />
<label class='c-input c-checkbox'><input type="checkbox" name="email_spam" value="1" <?= ($user_set['email_spam'] == 1 ? 'checked' : '') ?>><span class='c-indicator'></span> Включить АНТИСПАМ*</label><br />
<label class='c-input c-checkbox'><input type="checkbox" name="email_on" value="1" <?= ($user_set['email_on'] == 1 ? 'checked' : '') ?>><span class='c-indicator'></span> Примать E-mail от неизвестных контактов</label><br />
<button type="submit" name="save" class="btn btn-success"><span class="fa fa-save"></span> Сохранить</button>
</form>
<div class="list-group-item">
Все существующие контакты смогут вам писать независимо от настроек.<br />
Нежелательные контакты можете занести в СПАМ.<br />
* АНТИСПАМ - это система защиты от нежелательной почты (реклама, мошенничество и т.д)
</div>
<div class="list-group-item">
<a href="index.php"><span class='fa fa-arrow-left'></span> Назад</a>
</div>
<?php
include_once H . 'sys/inc/tfoot.php';