Location: PHPKode > projects > infoboard > infoboard/_req/user.php
<?
session_start();
include("../data/connect.php");
include("../data/_uconfig.php");
include("../_class/lang.php");
include("../_class/lang_".$iscon["getlang"].".php");
include("../_class/_func.php");
include("../_class/class.global.php");
include("../_class/class.req.php");

$infoboard = new req_infoboard();
$infoboard->checksess();
$infoboard->isconnect();

if(!$iscon["iduser"]) refback($iscon["lang"][112]);

$newpass =trim($_POST["newpass"]);
$mail =$_POST["mail"];

$website =$_POST["website"];
$banner = $_POST["banner"];
$ext = $_POST["ext"];

$icon = $_POST["icon"];

$icon = trim($icon);

if($icon){
	 if(file_exists("../_img/icon/".$icon.".jpg")){
		   if(copy("../_img/icon/".$icon.".jpg", "../data/user/".$iscon["user"].".jpg")){
			     $ext="jpg";
		   }
	 }
}else{
     if(isset($_FILES["image"]["size"])){
		  if($_FILES["image"]["size"] > $iscon["maxsize"]) refback($iscon["lang"][113]." (".$infoboard->img2bytes($iscon["maxsize"]).")");
		  $getext = strtolower($infoboard->getlast($_FILES["image"]["name"]));
		  if($getext == "gif"){
			    if(move_uploaded_file($_FILES["image"]["tmp_name"], "../data/user/".$iscon["user"].".gif")){
					  if(file_exists("../data/user/".$iscon["user"].".jpg")) unlink("../data/user/".$iscon["user"].".jpg");
					  $ext=$getext;
				}
		  }else{
			   if($infoboard->gdext($getext)){
					  if($im = $infoboard->imtype($_FILES["image"]["type"], $_FILES["image"]["tmp_name"])){
						    $infoboard->imgresize($im, 100, 100, "../data/user/", $iscon["user"]);
							ImageDestroy ($im);
							if(file_exists("../data/user/".$iscon["user"].".gif")) unlink("../data/user/".$iscon["user"].".gif");
							$ext=$getext;
					  }
			    }
		  }
    }
}


if($newpass){
	  $fieldupdate="
	  _pass='".md5($newpass)."',
	  _mail='".$mail."',
	  _website='".addslashes($website)."'
	  ";
}else{
	  $fieldupdate="
	  _mail='".$mail."',
	  _website='".addslashes($website)."'
	  ";
}

$point=0;
$point=$infoboard->fieldselect("_user", "_post", "_cid", $iscon["iduser"]);

$infoboard->iswrite("../data/user/banner/".$iscon["user"].".ext.dat", $ext."%".trim($point));

if($banner){
	 $banner = $infoboard->removescript1($banner);
	 $banner = $infoboard->removescript2($banner);
	 $infoboard->iswrite("../data/user/banner/".$iscon["user"].".dat", $banner);
}

$infoboard->iswrite("../data/user/".$iscon["user"].".txt", stripslashes($_POST["nickname"]));

if($infoboard->tbupdate("_user", $fieldupdate, "_cid", $iscon["iduser"])){
	     if($iscon["lockuser"] > 0)  $lockuser=1; else $lockuser="";
		 if($lockuser){
			  if($mail == $iscon["mailuser"]) $lockuser="";
		 }
		 if($lockuser){
			  $code = $infoboard->random(10);
			  $fieldupdate="
			  _active='0',
			  _code='".$code."'
			  ";
			  if($infoboard->tbupdate("_user", $fieldupdate, "_cid", $iscon["iduser"])){
				    $subject =$iscon["user"]." ".$iscon["lang"][101]." ".$iscon["website"];
					$message ="\r\n".$iscon["user"]." ".$iscon["lang"][102]." \r\n".$iscon["fullpath"]."?infoboard=active".$iscon["_s"].$iscon["user"].$iscon["_s"].base64_encode($code)."\n\n";
					if($txt=$infoboard->mailto($mail, $subject, $message)){
						 echo $txt;
						 exit();
						 refurl($iscon["lang"][103]." ".$mail."", "../");
					}else{
						 refback($iscon["lang"][104]);
					}
			  }
		 }else{
			  refurl($iscon["lang"][105], "../");
		 }
}


?>
Return current item: infoboard