<?
		$iserror = 0;

		$listuser -> checklogin($_SESSION["member"]->uid);
		
		if($act=="ok" and $iserror == 0 and $info_nickname == ""){
				$iserror = 1;
				$url = array("act" => "");
				$tourl = URL_user_information($url);
				$pagecontent = "保存失败！<br/>";	
				$pagecontent .= "昵称不能为空！<br/>";	
		}
		if($act=="ok" and $iserror == 0){
				$a1 = $db->query_num("select uid from ".JIEQI_DB_PREFIX."_system_users where name ='".$info_nickname."' and uid !=".$_SESSION["member"]->uid);
				if($a1){
						$iserror = 1;
						$url = array("act" => "");
						$tourl = URL_user_information($url);
						$pagecontent = "保存失败！<br/>";	
						$pagecontent .= "该昵称已经存在！<br/>";	
				}	
		}
		if($act=="ok" and $iserror == 0 and $info_emial == ""){
				$iserror = 1;
				$url = array("act" => "");
				$tourl = URL_user_information($url);
				$pagecontent = "保存失败！<br/>";	
				$pagecontent .= "邮箱不能为空！<br/>";		
		}
		if($act=="ok" and $iserror == 0){
				$a2 = $db->query_num("select uid from ".JIEQI_DB_PREFIX."_system_users where email ='".$info_emial."' and uid !=".$_SESSION["member"]->uid);
				if($a2){
						$iserror = 1;
						$url = array("act" => "");
						$tourl = URL_user_information($url);
						$pagecontent = "保存失败！<br/>";	
						$pagecontent .= "该邮箱已经存在！<br/>";	
				}	
		}
		if($act=="ok" and $iserror == 0){
				if(!ereg("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+",$info_emial)){
						$iserror = 1;
						$url = array("act" => "");
						$tourl = URL_user_information($url);
						$pagecontent = "保存失败！<br/>";	
						$pagecontent .= "请填写正确的邮箱地址！<br/>";	
				}
		}
		if($act=="ok" and $iserror == 0 and mb_strlen($info_sign,"utf-8")>60){
				$iserror = 1;
				$url = array("act" => "");
				$tourl = URL_user_information($url);
				$pagecontent = "保存失败！<br/>";	
				$pagecontent .= "您输入的签名长度超过60，请删减！<br/>";		
		}
		if($act=="ok" and $iserror == 0 and mb_strlen($info_intro,"utf-8")>60){
				$iserror = 1;
				$url = array("act" => "");
				$tourl = URL_user_information($url);
				$pagecontent = "保存失败！<br/>";	
				$pagecontent .= "您输入的个人简介长度超过60，请删减！<br/>";		
		}
		
		
		if($iserror == 0){
				if($act == "ok"){
						$db->query("UPDATE ".JIEQI_DB_PREFIX."_system_users SET name='".$info_nickname."',email='".$info_emial."',sex=".$info_sex.",sign='".$info_sign."',intro='".$info_intro."' WHERE uid=".$_SESSION["member"]->uid);
						
						$url = array();
						$tourl = URL_user_my_space($url);
						
						$_SESSION["member"]->name = $info_nickname;
						$_SESSION["member"]->email = $info_emial;
						$_SESSION["member"]->sex = $info_sex;
						$_SESSION["member"]->sign = $info_sign;
						$_SESSION["member"]->intro = $info_intro;
						
						$iserror = 1;
						$pagecontent = "保存成功！<br/>";	
				}else{
						$smartyObj->assign('getuserinfo',$db->query_object("select name,email,sex,sign,intro from ".JIEQI_DB_PREFIX."_system_users where uid=".$_SESSION["member"]->uid));
				}
		}
		
		if($iserror == 0){
				
				$smartydate = array("pagetitle" => "资料修改");
														
				$tplpath = "user/information.tpl";
				
		}else{
				
				$smartydate = array("pagetitle" => "资料修改",
														"pagecontent" => $pagecontent,
														"tourl" => $tourl,
														"redirecturl" => $tourl,
														);
														
				$tplpath = "public.tpl";
				
		}
?>