Размер файла: 6.76Kb
<?php
Defined('INDEX_S_S') or die ('Доступ запрещен!!!');
if (is_file($cms.'user/'.$_SESSION['user_login'].'/profile.php'))
{
if ($_POST['pokas'] == '')
{
include($cms.'user/'.$_SESSION['user_login'].'/profile.php');
?>
<table
style="width: 98%; text-align: left; margin-left: auto; margin-right: auto;"
border="0" cellpadding="4" cellspacing="0">
<tbody>
<tr>
<td style=" text-align: center; vertical-align: top; width: 125px;"><img src="<?php
echo trim(file_get_contents('user/'.$_SESSION['user_login'].'/avatar.txt'));
?>" width="125" alt="<?php echo $_SESSION['user_login'];?>" border="0">
<br />
<input class="knopka" OnCLick="show2('/function/ishod.php?', 'moduls/avatar/selected.php');" type="button" value="Общий список">
<br />
<input class="knopka" OnCLick="show2('/function/ishod.php?', 'moduls/avatar/selected_my.php');" type="button" value="Мои аватарки">
<br />
<input class="knopka" OnCLick="show2('/function/ishod.php?', 'moduls/avatar/add_photo.php');" type="button" value="Добавить фото">
</td>
<td style="text-align: left;">
<?php
echo '
X-STATUS: <a href="/?page=x_status">'.file_get_contents($cms.'user/'.$_SESSION['user_login'].'/x_status.txt').'</a>
<hr />';
?>
<form name="" action="" method="post">
Настоящее имя:<br />
<input name="name" type="text" value="<?php echo $user_name ?>">
<br />
Фамилия:<br />
<input name="user_fam" type="text" value="<?php echo $user_fam ?>">
<br />
Год рождения:<br />
<select size="1" name="age">
<?php
$age_cnt = date("Y")-75;
while ($age_cnt != (date("Y")-10))
{
if ($age_cnt == $age)
echo '<option selected value="'.$age_cnt.'">'.$age_cnt.'</option>';
else
echo '<option value="'.$age_cnt.'">'.$age_cnt.'</option>';
$age_cnt++;
}
?>
</select>
<br />
Номер телефона:<br />
<input name="numb" type="text" value="<?php echo $numb ?>">
<br />
Адрес проживания:<br />
<input name="adres" type="text" value="<?php echo $address ?>"><br />
О себе:<br />
<textarea style="width: 98%;" name="user_info" rows=8 cols=40><?php echo $user_info?></textarea>
<br />
<div ><input class="knopka" type="submit" value="Изменить"></div>
</td>
</tr>
</tbody>
</table>
<br />
Введите пароль (только для смены):
<input name="pass" type="text" value="">
<input name="pokas" type="hidden" value="7">
<input class="knopka" type="submit" value="Изменить">
</form>
<hr />
<form name="" action="" method="post">
E-mail:<br />
<input name="mail_regist" type="text" value="<?php echo $mail?>">
<input name="pokas" type="hidden" value="8">
<input class="knopka" type="submit" value="Изменить">
</form>
<hr />
<form name="" action="" method="post">
Выберите тему<br />
<?php
echo '<select size="1" name="s_tema">';
$s_tema = file_get_contents($cms.'user/'.$_SESSION['user_login'].'/tema.txt');
$dire = opendir ("dis");
while ($filee = readdir ($dire))
{ if (( $filee != ".") && ($filee != "..") && ($filee != "price.txt"))
{
if ($filee == $s_tema)
echo '<option selected value="'.$filee.'">'.$filee.'</option>';
else
echo '<option value="'.$filee.'">'.$filee.'</option>';
}
}
closedir ($dire);
echo '</select>';
?>
<input name="pokas" type="hidden" value="tema">
<input class="knopka" type="submit" value="Изменить">
</form>
<?php
}
elseif ($_POST['pokas'] == 7)
{
$name_in = substr(htmlspecialchars($_POST['name']),0,10);
$user_fam_in = substr(htmlspecialchars($_POST['user_fam']),0,10);
$mess1 = $_POST['user_info'];
include($cms.'flud/anti_x.php'); //анти мат полный фильтр
$user_info_in = $mess1;
$age_in = $_POST['age'];
include($cms.'user/'.$_SESSION['user_login'].'/profile.php');
if ($_POST['pass'] != '')
{
$pass_in = md5(substr($_POST['pass'],0,10));
}
else
{
include($cms.'user/'.$_SESSION['user_login'].'/profile.php');
$pass_in = $pass;
}
$fp = fopen ($cms.'user/'.$_SESSION['user_login'].'/profile.php', "w+");
fwrite ($fp,
'
<?php
Defined(\'INDEX_S_S\') or die (\'Доступ запрещен!!!\');
$user_name = \''.$name_in.'\';
$user_fam = \''.$user_fam_in.'\';
$user_info = \''.stripslashes($user_info_in).'\';
$pass = \''.$pass_in.'\';
$age = \''.$age_in.'\';
$mail = \''.$mail.'\';
$numb = \''.filt($_POST['numb']).'\';
$address = \''.filt($_POST['adres']).'\';
?>
');
fclose ($fp);
$activ = 'Отредактирован профиль.';
include($cms.'moduls/act/act_add.php');
echo '
<META HTTP-EQUIV="Refresh" CONTENT="0;">
';
}
elseif ($_POST['pokas'] == 8)
{
if (eregi("^([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](fo|g|l|m|mes|o|op|pa|ro|seum|t|u|v|z)?)$", $_POST['mail_regist']))
{
include($cms.'user/'.$_SESSION['user_login'].'/profile.php');
$mail_del = $mail;
$fp = fopen ($cms.'user/'.$_SESSION['user_login'].'/profile.php', "w+");
fwrite ($fp,
'
<?php
Defined(\'INDEX_S_S\') or die (\'Доступ запрещен!!!\');
$user_name = \''.$user_name.'\';
$user_fam = \''.$user_fam.'\';
$user_info = \''.stripslashes($user_info).'\';
$pass = \''.$pass.'\';
$age = \''.$age.'\';
$mail = \''.$_POST['mail_regist'].'\';
?>
');
fclose ($fp);
if (!is_file($cms.'user/cms_mail_page/'.$_POST['mail_regist']))
{
@unlink($cms.'user/cms_mail_page/'.$mail_del);
$fp = fopen ($cms.'user/cms_mail_page/'.$_POST['mail_regist'], "w+");
fclose ($fp);
$activ = 'Отредактирован профиль. Изменен E-Mail.';
include('moduls/act/act_add.php');
echo '
<META HTTP-EQUIV="Refresh" CONTENT="0;">
';
}
else
{
echo '
<span class="ramka">
E-mail уже существует!
</span>
<META HTTP-EQUIV="Refresh" CONTENT="2;">
';
}
}
else
{
echo '
<span class="ramka">
Невнерно введен e-mail!
</span>
<META HTTP-EQUIV="Refresh" CONTENT="2;">
';
}
}
elseif ($_POST['pokas'] == 'tema')
{
$fp = fopen ($cms.'user/'.$_SESSION['user_login'].'/tema.txt', "w+");
fwrite ($fp, trim($_POST['s_tema']));
fclose ($fp);
$_SESSION['cms_theme'] = trim($_POST['s_tema']);
$activ = 'Изменена активная тема.';
include($cms.'moduls/act/act_add.php');
echo '
<META HTTP-EQUIV="Refresh" CONTENT="0;">
';
}
}
else
{
echo '
<span class="ramka">
Ошибка доступа к базе.
</span>';
}
?>