Файл: mysite/frends/frend_access.php
Строк: 68
<?require_once ("../../core/cuctema/core.php");
only_reg();
$set['title'] = "Кто может видеть друзей";
require_once ("../../core/cuctema/head.php");
title();
aut();
if (isset($_POST['submited']))
{
if(in_array($_POST['access'],array('all','only_me','friends','friendsfriends','pass')))
{
$access=$_POST['access'];
} else $access='all';
if($access=='pass')
{
if(strlen2($_POST['passwd']) < 1)$err[] = 'Введите пароль.';
if(strlen2($_POST['passwd']) > 16)$err[] = 'Пароль слишком длинный.';
$password=$_POST['passwd'];
} else $password=NULL;
if (!isset($err))
{
mysql_query("UPDATE `user` SET `frend_access` = '$access', `frend_password` = '".my_esc($password)."' WHERE `id` = '$user[id]'");
header("Location: /mysite/frends");
exit();
}
}
?>
<div class="main">
<div class="menu123">
<div class=""><b>Кто может видеть ваших друзей</b></div></div><div class="main123">
<? err();?>
<form action="" method="post">
<div class="list_item">
<div>
<input type="radio" name="access" value="all"<? echo ($user['frend_access']=='all'?" checked='checked'":NULL);?>/>
<label><img src="http://i.spaces.ru/status_all.png" alt="Все"/> Все</label>
</div>
<div>
<input type="radio" name="access" value="only_me"<? echo ($user['frend_access']=='only_me'?" checked='checked'":NULL);?>/>
<label><img src="http://i.spaces.ru/status_me.png" alt="Только я"/> Только я</label>
</div>
<div>
<input type="radio" name="access" value="friends"<? echo ($user['frend_access']=='friends'?" checked='checked'":NULL);?>/>
<label><img src="http://i.spaces.ru/status_friends.png" alt="Мои друзья"/> Мои друзья</label>
</div>
<div>
<input type="radio" name="access" value="friendsfriends"<? echo ($user['frend_access']=='friendsfriends'?" checked='checked'":NULL);?>/>
<label><img src="http://i.spaces.ru/status_friendsfriends.png" alt="Мои друзья и их друзья"/> Мои друзья и их друзья</label>
</div>
<div>
<input type="radio" name="access" value="pass"<? echo ($user['frend_access']=='pass'?" checked='checked'":NULL);?>/>
<label><img src="http://i.spaces.ru/status_password.png" alt="Только по паролю"/> Только по паролю:</label>
<input name="passwd" size="16" maxlength="16" type="text" value="<? echo htmlspecialchars($user['frend_password']);?>" class="text_input" />
</div>
</div>
<input type="submit" name="submited" value="Сохранить" />
</form>
</div>
<div class="menu123">
<a class="arrow_link" href="/mysite/frends"> ← <span>Назад</span></a>
</div>
</div>
<?
require_once ("../../core/cuctema/foot.php");
?>