Просмотр файла forum/login/saveprof.php

Размер файла: 3.65Kb
<?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){

$n_password=check($n_password);
$agapass=check($agapass);
$city=check($city);
$about=check($about);
$height=check($height);
$weight=check($weight);
$happy=check($happy);
$name=check($name);
$icq=check($icq);
$podpis=check($podpis);

if(empty($agapass)){
include_once "../../css/red/index.php";
echo'<div class=agr><center>Изменение анкеты</center></div><div class=bgr>
Введите пароль подтверждения!</div>';
include_once "../../css/red/foot.php"; exit;}

if(empty($n_password)){
include_once "../../css/red/index.php";
echo'<div class=agr><center>Изменение анкеты</center></div><div class=bgr>
Введите пароль!</div>';
include_once "../../css/red/foot.php"; exit;}

$podpis2 = check(strlen($podpis));
$podpis2=check($podpis2);
if($podpis2>120){
include_once "../../css/red/index.php";
echo'<div class=agr><center>Изменение анкеты</center></div><div class=bgr>
Слишком длинная подпись! Макс. 60символов</div>';
include_once "../../css/red/foot.php"; exit;}

if($agapass!==$password){
include_once "../../css/red/index.php";
echo'<div class=agr><center>Изменение анкеты</center></div><div class=bgr>
Пароль подтверждения невереный!</div>';
include_once "../../css/red/foot.php"; exit;}

	if(eregi("[^a-z0-9-_=+()?]",$n_password))
	{
		include_once "../../css/red/index.php";
		echo'<div class=agr><p align="center">Изменение анкеты</p></div><div class=bgr>
		<center>Ошибка! Допустимы использовать буквы латинского алфавита, цифры и символы: <font color="red">-_=+()?</font> в поле пароль !
		<br><a href="profil.php?'.SID.'">Повторить</a><br>
		</center></div>';
		include_once "../../css/red/foot.php"; exit;
	}

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

$text=$udata[0].'|'.$n_password.'|'.$udata[2].'|'.$udata[3].'|'.$podpis.'|'.$udata[5].'|'.$udata[6].'|'.$udata[7].'|'.$udata[8].'|'.$name.'|'.$city.'|'.$about.'|'.$icq.'|'.$height.'|'.$weight.'|'.$happy.'|'.$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].'|';

	$off = @file("$maindir/forum/data/users/$login.log"); 
	$udata = explode("|",$off[0]);
	$npassword = $udata[1];
	$npassword= trim($npassword);
	
	if ($npassword==md5($_SESSION[password]))
	{

		$text=str_replace("\r\n", "", $text);
		$fp=fopen("$maindir/forum/data/users/$login.log","r+");
		ftruncate($fp,0);
		fputs($fp,"$text");
		fclose($fp);
		chmod ("$maindir/forum/data/users/$login.log", 0666);

		include_once "../../css/red/index.php";
		echo'<div class=agr><center>Изменение анкеты</center></div><div class=bgr>
		<center>Данные успешно изменены!';
		echo'<br><a href="../other/anketa.php?user='.$login.'&amp;'.SID.'">Просмотреть анкету<a></center><br></div>';
		include_once "../../css/red/foot.php";
		
		}else{ echo'ошибка';}

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

?>