Просмотр файла forum/admin/userchange.php

Размер файла: 5.24Kb
<?php
// автор скрипта - Arab
// icq - 9988817   сайт: http://bola.net.ru

include_once "../includ/functions.php";
include_once "../includ/login.php";
include_once "../includ/setting.php";
include_once "../includ/online.php";

if (!$_SESSION[login]=="" && !md5($_SESSION[password])=="" && md5($_SESSION[password])==$npassword && $_SESSION[login]==$nlogin){
if($m_level=="1" || $m_level=="2"){
include_once "../../css/red/index.php";

echo'<div class=agr><center><b>Изменение данных: '.$user.'</b></center></div><div class=bgr><div class=url>';

if($user=="$login"){ echo'<center><font color="ff1515">Внимание! Вы редактируете собственный профиль</font></center>'; }
$user=check($user);

if(isset($savepass)){
$savepass=full_check($savepass);

if(empty($newpass)){
echo'Введите пароль</div></div>';
include_once "../../css/red/foot.php"; exit;}
if(eregi("[^a-z0-9-_=+)(?]",$newpass)){
echo'Запрещенные символы в поле пароль</div></div>';
include_once "../../css/red/foot.php"; exit;}
$newpass=check($newpass);
$newpass=str_replace("\r\n", "", $newpass);
$nnewpass = md5($newpass);

$text = @file("$maindir/forum/data/users/".check($user).".log");
if ($text!=""){ $udata = explode("|",$text[0]);

$text=$udata[0].'|'.$nnewpass.'|'.$udata[2].'|'.$udata[3].'|'.$udata[4].'|'.$udata[5].'|'.$udata[6].'|'.$udata[7].'|'.$udata[8].'|'.$udata[9].'|'.$udata[10].'|'.$udata[11].'|'.$udata[12].'|'.$udata[13].'|'.$udata[14].'|'.$udata[15].'|'.$udata[16].'|'.$udata[17].'|'.$udata[18].'|'.$udata[19].'|'.$udata[20].'|'.$udata[21].'|'.$udata[22].'|'.$udata[23].'|'.$udata[24].'|'.$udata[25].'|'.$udata[26].'|'.$udata[27].'|'.$udata[28].'|'.$udata[29].'|';
$text=str_replace("\r\n", "", $text);

	$fp=fopen("$maindir/forum/data/users/".check($user).".log","r+");
	flock($fp,LOCK_EX);
	ftruncate($fp,0);
	fputs($fp,"$text");
	fflush($fp);
	flock($fp,LOCK_UN);
	fclose($fp); }

echo'Пароль пользователя <a href="../other/anketa.php?user='.$user.'">'.$user.'</a> успешно изменен на '.$newpass.'</div></div>';
include_once "../../css/red/foot.php"; exit; }

if(isset($save)){
$save=full_check($save);

$a1=check($a1);
$a2=check($a2);
$a3=check($a3);
$a4=check($a4);
$a5=check($a5);
$a6=check($a6);
$a7=check($a7);
$a8=check($a8);
$a9=check($a9);
$a10=check($a10);
$a11=check($a11);
$post=check($post);
$a13=check($a13);
$allban=check($allban);
$email=check($email);

$text = @file("$maindir/forum/data/users/".check($user).".log");
if ($text!=""){ $sss = explode("|",$text[0]);

$text=$sss[0].'|'.$sss[1].'|'.$sss[2].'|'.$sss[3].'|'.$sss[4].'|'.$a1.'|'.$sss[6].'|'.$email.'|'.$sss[8].'|'.$a2.'|'.$a3.'|'.$a4.'|'.$a5.'|'.$a6.'|'.$a7.'|'.$a8.'|'.$sss[16].'|'.$a9.'|'.$sss[18].'|'.$sss[19].'|'.$a10.'|'.$post.'|'.$allban.'|'.$sss[23].'|'.$a13.'|'.$sss[25].'|'.$sss[26].'|'.$sss[27].'|'.$sss[28].'|'.$sss[29].'|';

$text=str_replace("\r\n", "", $text);
$fp=fopen("$maindir/forum/data/users/".$user.".log","r+");
flock($fp,LOCK_EX);
fputs($fp,"$text");
fflush($fp);
flock($fp,LOCK_UN);
chmod ("$maindir/forum/data/users/$user.log", 0666); }


echo'Данные пользователя <a href="../other/anketa.php?user='.$user.'">'.$user.'</a> успешно сохранены!</div></div>';
include_once "../../css/red/foot.php"; exit; }


// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

$text = @file("$maindir/forum/data/users/".check($user).".log");
if ($text!=""){ $ud = explode("|",$text[0]);

	echo'<br><form method="post" action="userchange.php?savepass&user='.$user.'">
	Новый пароль
	<br><input name="newpass" value=""><br>
	<input value="Изменить" type="submit"></form><br>';

	echo'<br><form method="post" action="userchange.php?save&user='.$user.'">
	Уровень доступа: 
	<select name="a1" class="textbox">
	<option>'.$ud[5].'</option>
	<option>1</option>
	<option>2</option>
	<option>3</option>
	<option>4</option>
	</select><br>
	E-mail
	<br><input name="email" value="'.$ud[7].'"><br>
	Имя
	<br><input name="a2" value="'.$ud[9].'"><br>
	Город
	<br><input name="a3" value="'.$ud[10].'"><br>
	Обо мне
	<br><input name="a4" value="'.$ud[11].'"><br>
	ICQ
	<br><input name="a5" value="'.$ud[12].'"><br>
	Рост
	<br><input name="a6" value="'.$ud[13].'"><br>
	Вес
	<br><input name="a7" value="'.$ud[14].'"><br>
	День рождения
	<br><input name="a8" value="'.$ud[15].'"><br>
	Пол
	<br><input name="a9" value="'.$ud[17].'"><br>
	Баллы
	<br><input name="a10" value="'.$ud[20].'"><br>
	Постов на форуме
	<br><input name="post" value="'.$ud[21].'"><br>
	Количество нарушений
	<br><input name="allban" value="'.$ud[22].'"><br>
	Авторитет
	<br><input name="a13" value="'.$ud[24].'"><br>
	<input value="Cохранить" type="submit"></form><br>';

}else{
echo'<br><center>Пользователь <b>'.$user.'</b> не зарегестрирован или удален!</center><br>'; }

echo'</div></div>';
include_once "../../css/red/foot.php";

} else { header ("Location: ../index.php"); }
} else { header ("Location: ../index.php"); }

?>