<?php
class netsuserinfo extends netsDb {
	private $sysErrorClassID='0000';
	private $sysErrorFuncID=0;
	private $sysErrorID=0;
	
	public $sSite='http://';
	public $sKASDJI83VKJSDFKJSD=3;
	public $sUserinfoCookieStruct=array(
		array(0,'uitID'),array(0,'uitName'),array(0,'uitNumCode'),array(0,'uitUnitid'),
		array(0,'uitDepartmentid'),array(0,'uitPositionid'),array(0,'uitTypeid'),
		array(0,'uitGradeid'),array(0,'uitGroupid'),array(0,'uitChecked'),
		array(0,'uitState'),array(0,'uitCreateBy'),array(0,'uitCreateTime'),
		array(0,'uitPassTime'),array(0,'uitEmail'),array(0,'uitMobile'),array(0,'uitMoney'),
		array(0,'uitCode'),array(0,'uitExperience'),array(0,'uitTag'),
		array(0,'uitNickname'),array(0,'uitOnlineState'),array(0,'uitLoginAPI_Type'),
		
		array(1,'uictCircles'),array(1,'uictPxd_Question'),array(1,'uictPxd_Answer'),array(1,'uictCo_Name'),
		array(1,'uictCo_Sex'),array(1,'uictCo_Tele'),array(1,'uictCo_Mobile'),array(1,'uictCo_Fax'),array(1,'uictCo_Software'),array(1,'uictCo_Website'),
		array(1,'uictCo_NumCode'),array(1,'uictCo_ZoneChoose'),array(1,'uictCo_ZoneDetail'),array(1,'uictCo_Address'),array(1,'uictCo_Company'),
		array(1,'uictCo_PersPosition'),array(1,'uictCo_PersSpical'),array(1,'uictInfo_Hometown'),array(1,'uictInfo_Birthday'),array(1,'uictInfo_Age'),
		array(1,'uictTemplatepath_Unit'),array(1,'uictTemplatepath_Shop'),array(1,'uictTemplatepath_Blog'),array(1,'uictTemplatepath_Microblogging'),
		array(1,'uictPayAlipay'),array(1,'uictPayChinabank'),array(1,'uictPayTenpay'),array(1,'uictPay99Bill'),array(1,'uictPayYeepay'),
		array(1,'uictPayPaypal'),array(1,'uictPayType'),array(1,'uictPayCode'),array(1,'uictPayBankCode'),array(1,'uictPayBankName'),
		array(1,'uictPayBankUName'),array(1,'uictPayBankAddress'),array(1,'uictPayBankCountry'),array(1,'uictPayBankCountryCode'),
		array(1,'uictEmailSmtpIp'),array(1,'uictEmailSmtpPort'),array(1,'uictEmailSmtpName'),array(1,'uictEmailSmtpPxd'),array(1,'uictEmailPop3Able'),
		array(1,'uictEmailPop3Ip'),array(1,'uictEmailPop3Port'),array(1,'uictEmailPop3Name'),array(1,'uictEmailPop3Pxd'),array(1,'uictEmailImapAble'),
		array(1,'uictEmailImapIp'),array(1,'uictEmailImapName'),array(1,'uictEmailImapPxd'),array(1,'uictMapX'),array(1,'uictMapY'),
		array(1,'uictMapTagIntroduct'),array(1,'uictInterface_Pxd'),array(1,'uictCount_Views'),array(1,'uictCount_Reply'),array(1,'uictCode_Main'),
		array(1,'uictCode_Positive'),array(1,'uictCode_Negative'),array(1,'uictChecked_Mobile'),array(1,'uictChecked_Postcode'),array(1,'uictChecked_Bank'),
		array(1,'uictChecked_Email'),array(1,'uictChecked_Pay'),array(1,'uictPower_View'),array(1,'uictPower_ColumnsView'),array(1,'uictSourceR00'),

		);
	
	public function netsuserinfo($pConnection){
		$this->netsDb($pConnection);
	}
	public function delete_Clear($pDescriptions,$pIds,$pSPLIT){
		$this->sysErrorFuncID=$this->sysErrorClassID.'01';
		//-- ------ #Self ------ --
		$tmpINT=parent::delete($pDescriptions,$pIds,$pSPLIT);
		if($tmpINT!=0){
			return $tmpINT;
		}
		
		return 0;
	}
	public function Check(&$pTableDescriptAR,$pExceptionAR1,$pExceptionAR2){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';

		if(count($pExceptionAR1)==0){
			$pExceptionAR1=array();
		}
		parent::Check($pTableDescriptAR,$pExceptionAR1,$pExceptionAR2);
		//
		$tmpSTR='uitName';
		if(strlen($pTableDescriptAR[0]['Columns'][$tmpSTR]['Value'])<1 && !in_array($tmpSTR,$pExceptionAR2)){
			$this->sysLastError='提交内容错误:1.名称不能为空';
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ ### ------ --
		$tmpINT=$this->checkSKFCQWEJXVNSJL();
		if ($tmpINT!=0) {
			$this->sysLastError='对不起，您使用的是网集软件免费版本，用户数不能超过'.$this->sKASDJI83VKJSDFKJSD.'位';
			return $this->sysErrorFuncID.'001';
		}
		
		return 0;
	}
	
	//-- ------ #Register , Login , Logout , CheckPower , Getuserinfo ------ --
	/**
	 * Register new Core Unit
	 * Action:
	 * 1.Register new unit
	 * 2.Initial unit
	 * 2.1.Initial unit data to core db
	 * 2.2.Initial unit file directory
	 * 3.Add user by input data to unit origin user
	 * 3.1.Initial user data to core db
	 */
	public function RegUnit($pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//-- ------ ### ------ --
		$tmpINT=$this->checkSKFCQWEJXVNSJL();
		if ($tmpINT!=0) {
			$this->sysLastError='对不起，您使用的是网集软件免费版本，用户数不能超过'.$this->sKASDJI83VKJSDFKJSD.'位';
			return $this->sysErrorFuncID.'001';
		}
		
		$this->TransStart();
		//-- ------ #Check register able ------ --
		if($this->sysFileConfig['userUserRegAble']==0){
			$this->sysLastError='用户注册失败:本平台不允许新用户注册，请与管理员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Reg user ------ --
		//#Check uitName repeat
		$tmpSQL=' SELECT uitID FROM '.$this->sysTableHead.'netsuserinfo WHERE uitName LIKE \''.$pDescriptions[0]['Columns']['uitName']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError='用户注册失败:您所注册的用户名已经被使用，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//#Check uitEmail repeat
		$tmpSQL=' SELECT uitID FROM '.$this->sysTableHead.'netsuserinfo WHERE uitEmail LIKE \''.$pDescriptions[0]['Columns']['uitEmail']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError='用户注册失败:您所注册所用户使用的电子邮箱已经被使用，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		//-- ------ #Reg unit ------ --
		//#Check uutName repeat
		$tmpSQL=' SELECT uitID FROM '.$this->sysTableHead.'netsuserinfo WHERE uitName LIKE \''.$pDescriptions[2]['Columns']['uutName']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError='用户注册失败:您所注册的企业名称已经被使用，请更换后再试或申请加入该企业';
			$this->TransRollback();
			return $this->sysErrorFuncID.'003';
		}
		//-- ------ #Initial core data ------ --
		//#Add netsuserunit
		$tmpSTR='uutNumCode';
		$pDescriptions[2]['TableDescription']['SearchColumn']=$tmpSTR;
		$pDescriptions[2]['Columns'][$tmpSTR]['Value']='Unit'.date('YmdHis');
		$tmpINT=$this->DNumCode($pDescriptions[2]);
		
		$tmpDescription=array();
		$tmpDescription[0]=$pDescriptions[2];
		$tmpDescription[1]=$pDescriptions[3];
		$tmpDescription[0]['TableDescription']['SearchColumn']='uutNumCode,uutID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='uuctIndexID';
		$tmpINT=$this->DAdd($tmpDescription);
		if($tmpINT!=0){
			$this->sysLastError='用户注册失败:注册用户时出错，请稍后再试';
			$this->TransRollback();
			return $tmpINT;
		}
		//#Add netsuserinfo
		$tmpSTR='uitNumCode';
		$pDescriptionAR[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$pDescriptionAR[0]['Columns'][$tmpSTR]['Value']='User'.date('YmdHis');
		$tmpINT=$this->DNumCode($pDescriptions[0]);
		
		$pDescriptionAR[0]['Columns']['uitName']['Value']=$pDescriptionAR[0]['Columns']['uitNumCode']['Value'];
		$tmpUnitid=$tmpDescription[1]['Columns']['uuctIndexID']['Value'];
		$pDescriptions[0]['Columns']['uitUnitid']['Value']=$tmpUnitid;
		$pDescriptions[0]['Columns']['uitDepartmentid']['Value']=1;
		$tmpSTR=$tmpCode->IntToTime_T($tmpCode->TimeToInt_T(date($this->sysTimeFormat))+$this->sysFileConfig['unitRegisterPassTime']);
		$pDescriptions[0]['Columns']['uitPassTime']['Value']=$tmpSTR;
		//-- #Check --
		if($this->sysFileConfig['userUserMailCheckAble']==1){
			$pDescriptions[0]['Columns']['uitChecked']['Value']=0;
			$pDescriptions[0]['Columns']['uitState']['Value']=0;
		}else if($this->sysFileConfig['userUserMailCheckAble']==2){
			$pDescriptions[0]['Columns']['uitChecked']['Value']=2;
			$pDescriptions[0]['Columns']['uitState']['Value']=2;
		}else {
			$pDescriptions[0]['Columns']['uitChecked']['Value']=2;
			$pDescriptions[0]['Columns']['uitState']['Value']=0;
		}
		if($this->sysFileConfig['userUserCheckAble']==1){
			$pDescriptions[0]['Columns']['uitChecked']['Value']=0;
		}
		
		
		$tmpDescription=array();
		$tmpDescription[0]=$pDescriptions[0];
		$tmpDescription[1]=$pDescriptions[1];
		$tmpDescription[0]['TableDescription']['SearchColumn']='uitNumCode,uitID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='uictIndexID';
		$tmpINT=$this->add($tmpDescription);
		if($tmpINT!=0){
			$this->sysLastError='用户注册失败:注册用户时出错，请稍后再试';
			$this->TransRollback();
			return $tmpINT;
		}
		//-- ------ #Initial dir ------ --
		$tmpUnitid=101;
		//#Copy file
		$tmpSectionName=$tmpCode->AccountSectionName($tmpUnitid,$this->sysFileConfig['UserDirSectionSize']);
		$tmpSysConfig0=$pDescriptions[2]['Columns']['uutName']['Value'];
		$tmpSysConfig1=$tmpSysConfig0.'_'.rand(0,99999999);
		$tmpSourcePath=$this->sysFileConfig['UserDirPathTemplate'];
		$tmpDestinationPath=$this->sysFileConfig['UserDirPathString'].'n'.$tmpSectionName.'/'.$tmpSysConfig0.'/';
		$tmpINT=$this->createDir($tmpDestinationPath);
		$tmpINT=$this->copyAllFileTo($tmpSourcePath,$tmpDestinationPath);
		$tmpINT=rename($tmpDestinationPath.$this->sysFileConfig['UserDirDataPath'].'nets_db0.mdb',$tmpDestinationPath.$this->sysFileConfig['UserDirDataPath'].$tmpSysConfig1.'.mdb');
		//#Reset netsuserunit
		$tmpSQL=' UPDATE '.$this->sysTableHead.'netsuserunit SET uutCreateBy='.$tmpDescription[0]['Columns']['uictIndexID']['Value'].' WHERE uutID='.$tmpUnitid.' ';
		$tmpINT=$this->Execute($tmpSQL);
		if($tmpINT!=0){
			$this->sysLastError='用户注册失败:注册用户时出错，请稍后再试';
			$this->TransRollback();
			return $tmpINT;
		}
		$tmpSQL=' UPDATE netsuserunitcont SET uuctSysConfig=\''.$tmpSysConfig1.'\' WHERE uuctIndexID='.$tmpUnitid.' ';
		$tmpINT=$this->Execute($tmpSQL);
		if($tmpINT!=0){
			$this->sysLastError='用户注册失败:注册用户时出错，请稍后再试';
			$this->TransRollback();
			return $tmpINT;
		}
		
		$this->TransCommit();
		return 0;
	}
	/**
	 * Register new User to exist Core db Unit
	 * 1.Add user by input data to unit
	 * 1.1.Initial user data to core db
	 */
	public function RegAddToUnit($pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//-- ------ ### ------ --
		$tmpINT=$this->checkSKFCQWEJXVNSJL();
		if ($tmpINT!=0) {
			$this->sysLastError='对不起，您使用的是网集软件免费版本，用户数不能超过'.$this->sKASDJI83VKJSDFKJSD.'位';
			return $this->sysErrorFuncID.'001';
		}
		
		$this->TransStart();
		//-- ------ #Check register able ------ --
		if($this->sysFileConfig['userUserRegAble']==0){
			$this->sysLastError='用户注册失败:本平台不允许新用户注册，请与管理员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Reg user ------ --
		//#Check uitName repeat
		$tmpSQL=' SELECT uitID FROM '.$this->sysTableHead.'netsuserinfo WHERE uitName LIKE \''.$pDescriptions[0]['Columns']['uitName']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError='用户注册失败:您所注册的用户名已经被使用，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		/*
		//#Check uitEmail repeat
		$tmpSQL=' SELECT uitID FROM '.$this->sysTableHead.'netsuserinfo WHERE uitEmail LIKE \''.$pDescriptions[0]['Columns']['uitEmail']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError='用户注册失败:您所注册所用户使用的电子邮箱已经被使用，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		//#Check uitMobile repeat
		$tmpSQL=' SELECT uitID FROM '.$this->sysTableHead.'netsuserinfo WHERE uitMobile LIKE \''.$pDescriptions[0]['Columns']['uitMobile']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError='用户注册失败:您所注册所用户使用的手机号已经被使用，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		*/
		//#Check uitUnitid
		$tmpSQL=' SELECT uutID,uutName,uutRecycle,uutChecked FROM '.$this->sysTableHead.'netsuserunit WHERE uutID='.$pDescriptions[0]['Columns']['uitUnitid']['Value'].' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)==0){
			$this->sysLastError='用户注册失败:您所要加入的单位在系统中并不存在，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'003';
		}
		if($tmpDataCollection0[0]['uutRecycle']!=0 || $tmpDataCollection0[0]['uutChecked']<2){
			$this->sysLastError='用户注册失败:您所要加入的单位已被禁用，请与相关人员联系或更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'004';
		}
		/*
		//#Check uitDepartmentid
		$tmpSQL=' SELECT udeptID,udeptName,udeptRecycle,udeptChecked 
			FROM netsuserdepartment WHERE udeptID='.$pDescriptions[0]['Columns']['uitDepartmentid']['Value'].' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)==0){
			$this->sysLastError='用户注册失败:您所要加入的单位在系统中并不存在，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'005';
		}
		if($tmpDataCollection0[0]['udeptRecycle']!=0 || $tmpDataCollection0[0]['udeptChecked']<2){
			$this->sysLastError='用户注册失败:您所要加入的部门已被禁用，请与相关人员联系或更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'006';
		}
		*/
		//#Add user
		$tmpSTR=$tmpCode->IntToTime_T($tmpCode->TimeToInt_T(date($this->sysTimeFormat))+$this->sysFileConfig['userRegisterPassTime']);
		$pDescriptions[0]['Columns']['uitPassTime']['Value']=$tmpSTR;
		//-- #Check --
		if($this->sysFileConfig['userUserMailCheckAble']==1){
			$pDescriptions[0]['Columns']['uitChecked']['Value']=0;
			$pDescriptions[0]['Columns']['uitState']['Value']=0;
		}else if($this->sysFileConfig['userUserMailCheckAble']==2){
			$pDescriptions[0]['Columns']['uitChecked']['Value']=2;
			$pDescriptions[0]['Columns']['uitState']['Value']=2;
		}else {
			$pDescriptions[0]['Columns']['uitChecked']['Value']=2;
			$pDescriptions[0]['Columns']['uitState']['Value']=0;
		}
		if($this->sysFileConfig['userUserCheckAble']==1){
			$pDescriptions[0]['Columns']['uitChecked']['Value']=0;
		}
		
		$tmpSTR='uitNumCode';
		$pDescriptions[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$pDescriptions[0]['Columns'][$tmpSTR]['Value']='User'.date('YmdHis');
		$tmpINT=$this->numCode($pDescriptions[0]);
		
		$tmpDescription=array();
		$tmpDescription[0]=$pDescriptions[0];
		$tmpDescription[1]=$pDescriptions[1];
		$tmpDescription[0]['Columns']['uitPxd']['Value']=$tmpCode->SamplePxd($pDescriptions[0]['Columns']['uitPxd']['Value']);
		$tmpDescription[0]['TableDescription']['SearchColumn']='uitNumCode,uitID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='uictIndexID';
		$tmpINT=$this->add($tmpDescription);
		if($tmpINT!=0){
			$this->sysLastError='用户注册失败:注册用户时出错，请稍后再试';
			$this->TransRollback();
			return $tmpINT;
		}

		$this->TransCommit();
		return 0;
	}
	/**
	 * Register new User to now db
	 * Action:
	 * 1.Create new unit to now db
	 * 1.1.Initial new unit data
	 * 2.Create new user to this unit
	 * 2.1.Initial new user data
	 */
	public function RegUserNormal($pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//-- ------ ### ------ --
		$tmpINT=$this->checkSKFCQWEJXVNSJL();
		if ($tmpINT!=0) {
			$this->sysLastError='对不起，您使用的是网集软件免费版本，用户数不能超过'.$this->sKASDJI83VKJSDFKJSD.'位';
			return $this->sysErrorFuncID.'001';
		}
		
		$this->TransStart();
		//-- ------ #Check register able ------ --
		if($this->sysFileConfig['userUserRegAble']==0){
			$this->sysLastError='用户注册失败:本平台不允许新用户注册，请与管理员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Check input ------ --
		//#Check uitName repeat
		$tmpSQL=' SELECT uitID FROM '.$this->sysTableHead.'netsuserinfo WHERE uitName LIKE \''.$pDescriptions[0]['Columns']['uitName']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError='用户注册失败:您所注册的用户名已经被使用，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//#Check uitEmail repeat
		$tmpSQL=' SELECT uitID FROM '.$this->sysTableHead.'netsuserinfo WHERE uitEmail LIKE \''.$pDescriptions[0]['Columns']['uitEmail']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError='用户注册失败:您所注册所用户使用的电子邮箱已经被使用，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		//#Check uutName repeat
		$pDescriptions[2]['Columns']['uutName']['Value']=$pDescriptions[0]['Columns']['uitName']['Value'];
		$tmpSQL=' SELECT uutID FROM '.$this->sysTableHead.'netsuserunit WHERE uutName LIKE \''.$pDescriptions[2]['Columns']['uutName']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError=' - 用户注册失败:您所注册所用户使用的单位名称已经被使用，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'003';
		}
		//-- ------ #Create unit ------ --
		//Setting
		$tmpSTR='uutNumCode';
		$pDescriptions[2]['TableDescription']['SearchColumn']=$tmpSTR;
		$pDescriptions[2]['Columns'][$tmpSTR]['Value']='Un'.$this->sysSPLIT11.date('YmdHis');
		$tmpINT=$this->numCode($pDescriptions[2]);
		
		$pDescriptions[2]['Columns']['uutChecked']['Value']=2;
		$pDescriptions[2]['Columns']['uutCreateBy']['Value']=13;
		$pDescriptions[2]['Columns']['uutCreateTime']['Value']=date($this->sysTimeFormat);
		$tmpSTR=$tmpCode->IntToTime_T($tmpCode->TimeToInt_T(date($this->sysTimeFormat))+$this->sysFileConfig['unitRegisterPassTime']);
		$pDescriptions[2]['Columns']['uutPassTime']['Value']=$tmpSTR;
		//Adding
		$tmpDescription=array();
		$tmpDescription[0]=$pDescriptions[2];
		$tmpDescription[1]=$pDescriptions[3];
		$tmpDescription[0]['TableDescription']['SearchColumn']='uutNumCode,uutID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='uuctIndexID';
		$tmpINT=$this->add($tmpDescription);
		if($tmpINT!=0){
			$this->sysLastError='用户注册失败:注册用户时出错，请稍后再试';
			$this->TransRollback();
			return $tmpINT;
		}
		//-- ------ #Initial unit ------ --
		//-- ------ #Create user ------ --
		//Setting
		$tmpSTR='uitNumCode';
		$pDescriptions[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$pDescriptions[0]['Columns'][$tmpSTR]['Value']='U'.$this->sysSPLIT11.date('YmdHis');
		$tmpINT=$this->numCode($pDescriptions[0]);
		
		$pDescriptions[0]['Columns']['uitName']['Value']=$pDescriptions[0]['Columns']['uitNumCode']['Value'];
		$pDescriptions[0]['Columns']['uitTypeid']['Value']=5;
		$pDescriptions[0]['Columns']['uitGroupid']['Value']=1;
		$pDescriptions[0]['Columns']['uitCreateBy']['Value']=13;
		$pDescriptions[0]['Columns']['uitCreateTime']['Value']=date($this->sysTimeFormat);
		$tmpSTR=$tmpCode->IntToTime_T($tmpCode->TimeToInt_T(date($this->sysTimeFormat))+$this->sysFileConfig['userRegisterPassTime']);
		$pDescriptions[0]['Columns']['uitPassTime']['Value']=$tmpSTR;
		//-- #Check --
		if($this->sysFileConfig['userUserCheckAble']==1){
			$pDescriptions[0]['Columns']['uitChecked']['Value']=0;
		}else if($this->sysFileConfig['userUserMailCheckAble']==1){
			$pDescriptions[0]['Columns']['uitChecked']['Value']=0;
		}else {
			$pDescriptions[0]['Columns']['uitChecked']['Value']=2;
		}
		
		$tmpSQL=' SELECT A.uutID FROM '.$this->sysTableHead.'netsuserunit AS A 
			WHERE 1=1 AND A.uutRecycle=0 AND A.uutChecked>1 AND 
			A.uutNumCode LIKE \''.$pDescriptions[2]['Columns']['uutNumCode']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$pDescriptions[0]['Columns']['uitUnitid']['Value']=$tmpDataCollection0[0]['uutID'];
			$pDescriptions[2]['Columns']['uutID']['Value']=$tmpDataCollection0[0]['uutID'];
		}else {
			$this->sysLastError='用户注册失败:注册用户时出错，请稍后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'005';
		}
		//Adding
		$tmpDescription=array();
		$tmpDescription[0]=$pDescriptions[0];
		$tmpDescription[1]=$pDescriptions[1];
		$tmpDescription[0]['TableDescription']['SearchColumn']='uitNumCode,uitID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='uictIndexID';
		$tmpINT=$this->add($tmpDescription);
		if($tmpINT!=0){
			$this->sysLastError='用户注册失败:注册用户时出错，请稍后再试';
			$this->TransRollback();
			return $tmpINT;
		}
		//-- ------ #Initial user ------ --
		$tmpSQL=' SELECT A.uitID FROM '.$this->sysTableHead.'netsuserinfo AS A 
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitChecked>1 AND 
			A.uitNumCode LIKE \''.$pDescriptions[0]['Columns']['uitNumCode']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$pDescriptions[0]['Columns']['uitID']['Value']=$tmpDataCollection0[0]['uitID'];
			$pDescriptions[2]['Columns']['uutCreateBy']['Value']=$tmpDataCollection0[0]['uitID'];
		}
		$tmpSQL=' UPDATE netsuserunit 
			SET uutCreateBy='.$pDescriptions[2]['Columns']['uutCreateBy']['Value'].' 
			WHERE 1=1 AND uutID='.$pDescriptions[2]['Columns']['uutID']['Value'].' ';
		$tmpINT=$this->Execute($tmpSQL);
		if($tmpINT!=0){
			$this->sysLastError='用户注册失败:注册用户时出错，请稍后再试';
			$this->TransRollback();
			return $tmpINT;
		}
		
		$this->TransCommit();
		return 0;
	}
	public function RegUserUnit($pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//-- ------ ### ------ --
		$tmpINT=$this->checkSKFCQWEJXVNSJL();
		if ($tmpINT!=0) {
			$this->sysLastError='对不起，您使用的是网集软件免费版本，用户数不能超过'.$this->sKASDJI83VKJSDFKJSD.'位';
			return $this->sysErrorFuncID.'001';
		}
		
		$this->TransStart();
		//-- ------ #Check register able ------ --
		if($this->sysFileConfig['userUserRegAble']==0){
			$this->sysLastError='用户注册失败:本平台不允许新用户注册，请与管理员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Reg user ------ --
		//#Check uitName repeat
		$tmpSQL=' SELECT uitID FROM '.$this->sysTableHead.'netsuserinfo WHERE uitName LIKE \''.$pDescriptions[0]['Columns']['uitName']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError='用户注册失败:您所注册的用户名已经被使用，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//#Check uitEmail repeat
		$tmpSQL=' SELECT uitID FROM '.$this->sysTableHead.'netsuserinfo WHERE uitEmail LIKE \''.$pDescriptions[0]['Columns']['uitEmail']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError='用户注册失败:您所注册所用户使用的电子邮箱已经被使用，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		//-- ------ #Reg unit ------ --
		//#Check uutName repeat
		$tmpSQL=' SELECT uitID FROM '.$this->sysTableHead.'netsuserinfo WHERE uitName LIKE \''.$pDescriptions[2]['Columns']['uutName']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError='用户注册失败:您所注册的用户名已经被使用，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'003';
		}
		//-- ------ #Initial core data ------ --
		//#Add netsuserunit
		$tmpSTR='uutNumCode';
		$pDescriptions[2]['TableDescription']['SearchColumn']=$tmpSTR;
		$pDescriptions[2]['Columns'][$tmpSTR]['Value']='Unit'.date('YmdHis');
		$tmpINT=$this->numCode($pDescriptions[2]);
		//Adding
		$tmpDescription=array();
		$tmpDescription[0]=$pDescriptions[2];
		$tmpDescription[1]=$pDescriptions[3];
		$tmpDescription[0]['TableDescription']['SearchColumn']='uutNumCode,uutID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='uuctIndexID';
		$tmpINT=$this->add($tmpDescription);
		if($tmpINT!=0){
			$this->sysLastError='用户注册失败:注册用户时出错，请稍后再试';
			$this->TransRollback();
			return $tmpINT;
		}
		//#Add netsuserinfo
		$tmpSTR='uitNumCode';
		$pDescriptions[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$pDescriptions[0]['Columns'][$tmpSTR]['Value']='User'.date('YmdHis');
		$tmpINT=$this->numCode($pDescriptions[0]);
		
		$pDescriptions[0]['Columns']['uitName']['Value']=$pDescriptions[0]['Columns']['uitNumCode']['Value'];
		$pDescriptions[0]['Columns']['uitUnitid']['Value']=$pDescriptions[1]['Columns']['uuctIndexID']['Value'];
		$pDescriptions[0]['Columns']['uitDepartmentid']['Value']=1;
		$tmpSTR=$tmpCode->IntToTime_T($tmpCode->TimeToInt_T(date($this->sysTimeFormat))+$this->sysFileConfig['userRegisterPassTime']);
		$pDescriptions[0]['Columns']['uitPassTime']['Value']=$tmpSTR;
		//-- #Check --
		if($this->sysFileConfig['userUserCheckAble']==1){
			$pDescriptions[0]['Columns']['uitChecked']['Value']=0;
		}else if($this->sysFileConfig['userUserMailCheckAble']==1){
			$pDescriptions[0]['Columns']['uitChecked']['Value']=0;
		}else {
			$pDescriptions[0]['Columns']['uitChecked']['Value']=2;
		}
		//Adding
		$tmpDescription=array();
		$tmpDescription[0]=$pDescriptions[0];
		$tmpDescription[1]=$pDescriptions[1];
		$tmpDescription[0]['TableDescription']['SearchColumn']='uitNumCode,uitID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='uictIndexID';
		$tmpINT=$this->add($tmpDescription);
		if($tmpINT!=0){
			$this->sysLastError='用户注册失败:注册用户时出错，请稍后再试';
			$this->TransRollback();
			return $tmpINT;
		}
		//#Reset netsuserunit
		$tmpSQL=' UPDATE '.$this->sysTableHead.'netsuserunit 
			SET uutCreateBy='.$pDescriptions[2]['Columns']['uutCreateBy']['Value'].' 
			WHERE 1=1 AND uutID='.$pDescriptions[2]['Columns']['uutID']['Value'].' ';
		$tmpINT=$this->Execute($tmpSQL);
		if($tmpINT!=0){
			$this->sysLastError='用户注册失败:注册用户时出错，请稍后再试';
			$this->TransRollback();
			return $tmpINT;
		}
		
		$this->TransCommit();
		return 0;
	}
	public function AutoRegister(&$pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//-- ------ ### ------ --
		$tmpINT=$this->checkSKFCQWEJXVNSJL();
		if ($tmpINT!=0) {
			$this->sysLastError='对不起，您使用的是网集软件免费版本，用户数不能超过'.$this->sKASDJI83VKJSDFKJSD.'位';
			return $this->sysErrorFuncID.'001';
		}
		
		$this->TransStart();
		//-- ------ #Register ------ --
		$tmpSQL=' SELECT A.uitID,A.uitName,A.uitPxd,A.uitNumCode,A.uitNickname,A.uitState,B.uictRemark
			FROM ({Nets.TableHead}netsuserinfo AS A
			INNER JOIN {Nets.TableHead}netsuserinfocont AS B ON B.uictIndexID=A.uitID)
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitChecked>1 AND A.uitState=1 AND A.uitTypeid=5 AND 
			(DAYOFMONTH(A.uitCreateTime)-3)<=DAYOFMONTH(NOW())
			ORDER BY A.uitID LIMIT 0,1 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)>0){
			//-- ------ #Get old ------ --
			$pDescriptions[0]['Columns']['uitName']['Value']=$tmpData0[0]['uitName'];
			$pDescriptions[0]['Columns']['uitPxd']['Value']=$tmpData0[0]['uitPxd'];
		}else {
			//-- ------ #Register ------ --
			//-- ------ #Check register able ------ --
			if($this->sysFileConfig['userUserRegAble']==0){
				$this->sysLastError='用户注册失败:本平台不允许新用户注册，请与管理员联系。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			//#Add user
			$tmpSTR='uitNumCode';
			$pDescriptions[0]['TableDescription']['SearchColumn']=$tmpSTR;
			$pDescriptions[0]['Columns'][$tmpSTR]['Value']='User'.date('YmdHis');
			$tmpINT=$this->numCode($pDescriptions[0]);
			
			$tmpName=date('YmdHis');
			$tmpSQL=' SELECT A.uitID,A.uitName FROM {Nets.TableHead}netsuserinfo AS A
				WHERE 1=1 AND uitName LIKE \'{Nets.NameHead}{Nets.Name}\' ';
			$tmpSQL=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSQL=str_replace('{Nets.NameHead}',$this->sysFileConfig['userAutoRegisterNameHead'],$tmpSQL);
			$Coun0=0;
			$tmpRandCode='00000';
			while($Coun0>=0){
				$tmpRandSTR=$tmpName.rand(0,99999);
				$tmpRandCode=rand(0,99999);
				
				$tmpSTR=str_replace('{Nets.Name}',$tmpRandSTR,$tmpSQL);
				$tmpData0=$this->Search($tmpSTR);
				if(count($tmpData0)==0){
					$Coun0=-1;
				}else if($Coun0>$this->sysFileConfig['NumcodeMakeCount']){
					$this->sysLastError='用户注册失败:生成用户名错误，请与管理员联系。';
					$this->TransRollback();
					return $this->sysErrorFuncID.'001';
				}
				//$Coun0++;
			}
			$tmpName=$tmpRandSTR;
			$tmpPxd=rand(0,$this->sysFileConfig['userAutoRegisterPxdSeed']);
			
			$pDescriptions[0]['Columns']['uitName']['Value']=$this->sysFileConfig['userAutoRegisterNameHead'].$tmpName;
			$pDescriptions[0]['Columns']['uitUnitid']['Value']=$this->sysFileConfig['userAutoRegisterUnitid'];
			$tmpSTR=$tmpCode->IntToTime_T($tmpCode->TimeToInt_T(date($this->sysTimeFormat))+$this->sysFileConfig['userAutoRegisterPassTime']);
			$pDescriptions[0]['Columns']['uitPassTime']['Value']=$tmpSTR;
			$pDescriptions[0]['Columns']['uitChecked']['Value']=2;
			$pDescriptions[0]['Columns']['uitTypeid']['Value']=5;
			$pDescriptions[0]['Columns']['uitGradeid']['Value']=0;
			$pDescriptions[0]['Columns']['uitGroupid']['Value']=0;
			$pDescriptions[0]['Columns']['uitState']['Value']=1;
			$pDescriptions[0]['Columns']['uitCreateBy']['Value']=0;
			$pDescriptions[0]['Columns']['uitCreateTime']['Value']=date($this->sysTimeFormat);
			$pDescriptions[0]['Columns']['uitEmail']['Value']=$tmpName.$this->sysFileConfig['userAutoRegisterEmailHead'];
			$pDescriptions[0]['Columns']['uitPxd']['Value']=$tmpCode->SamplePxd($tmpPxd);
			$pDescriptions[0]['Columns']['uitNickname']['Value']=$this->sysFileConfig['userAutoRegisterNicknameHead'].$tmpRandCode;
			$pDescriptions[0]['Columns']['uitOnlineState']['Value']=0;
			
			$tmpSTR=str_replace('{Nets.PassDayCount}',$pDescriptions[0]['Columns']['uitName']['Value'],$this->sysFileConfig['userAutoRegisterIntroductTemplate']);
			$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.Pxd}',$tmpPxd,$tmpSTR);
			$tmpSTR=str_replace('{Nets.Nickname}',$pDescriptions[0]['Columns']['uitNickname']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.Email}',$pDescriptions[0]['Columns']['uitEmail']['Value'],$tmpSTR);
			$pDescriptions[1]['Columns']['uictRemark']['Value']=$tmpSTR;
			
			$tmpDescriptions=array();
			$tmpDescriptions[0]=$pDescriptions[0];
			$tmpDescriptions[1]=$pDescriptions[1];
			$tmpDescriptions[0]['TableDescription']['SearchColumn']='uitNumCode,uitID';
			$tmpDescriptions[1]['TableDescription']['SearchColumn']='uictIndexID';
			$tmpINT=$this->add($tmpDescriptions);
			if($tmpINT!=0){
				$this->sysLastError='用户注册失败:注册用户时出错，请稍后再试';
				$this->TransRollback();
				return $tmpINT;
			}
		}
		//-- ------ #Login ------ --
		$pDescriptions[0]['Columns']['uitOnlineState']['Value']=1;
		//-- ------ # ------ --
		//#Check uitName
		$tmpSQL=' SELECT A.uitID
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitName LIKE \'{Nets.Name}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)!=1){
			$this->sysLastError='用户登陆失败:用户不存在';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//#Check uitPxd
		$pDescriptions[0]['Columns']['uitPxd']['Value']=$pDescriptions[0]['Columns']['uitPxd']['Value'];
		$tmpSQL=' SELECT A.uitID,A.uitNumCode
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND uitRecycle=0 AND A.uitName LIKE \'{Nets.Name}\' AND A.uitPxd LIKE \'{Nets.Pxd}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Pxd}',$pDescriptions[0]['Columns']['uitPxd']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)!=1){
			$this->sysLastError='用户登陆失败:密码错误';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		$pDescriptions[0]['Columns']['uitID']['Value']=$tmpData0[0]['uitID'];
		$pDescriptions[0]['Columns']['uitNumCode']['Value']=$tmpData0[0]['uitNumCode'];
		//-- ------ #Check ------ --
		$tmpINT=$this->CheckPower($pDescriptions,1);
		if($tmpINT!=0){
			$this->TransRollback();
			return $tmpINT;
		}
		//-- ------ #Update ------ --
		$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfo SET uitOnlineState={Nets.OnlineState}
			WHERE 1=1 AND uitID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		if($pDescriptions[0]['Columns']['uitOnlineState']['Value']!=0){
			$tmpSTR=str_replace('{Nets.OnlineState}',$pDescriptions[0]['Columns']['uitOnlineState']['Value'],$tmpSTR);
		}else {
			$tmpSTR=str_replace('{Nets.OnlineState}',1,$tmpSTR);
		}
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if($tmpINT!=0){
			$this->sysLastError='用户登陆失败:更新用户状态时出错，请稍后再试或与管理员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Write daily ------ --
		$tmpDescription=array($this->sDbDescriptions_Other[0][0],
			$this->sDbDescriptions_Other[0][1],);
		//#Get numCode
		$tmpSTR='udtNumCode';
		$tmpDescription[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$tmpDescription[0]['Columns'][$tmpSTR]['Value']='N_'.date('YmdHis');
		$this->numCode($tmpDescription[0]);

		$tmpSTR=$tmpDescription[1]['Columns']['udctIntroduct']['Value'];
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Unit}',$pDescriptions[2]['Columns']['uutName']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Type}',$pDescriptions[4]['Columns']['uttName']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Group}',$pDescriptions[8]['Columns']['ugtName']['Value'],$tmpSTR);
		$tmpAR0=explode($this->sysSPLIT4,$tmpSTR);
		$tmpDescription[0]['Columns']['udtName']['Value']=$tmpAR0[0];
		$tmpDescription[1]['Columns']['udctIntroduct']['Value']=$tmpSTR;
		$tmpDescription[0]['Columns']['udtCreateTime']['Value']=date($this->sysTimeFormat);

		$tmpDescription[0]['TableDescription']['SearchColumn']='udtNumCode,udtID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='udctIndexID';
		$tmpINT=$this->add($tmpDescription);
		if($tmpINT!=0){
			$this->sysLastError='用户登陆失败:生成日志时出错，请稍后再试或与管理员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		
		
		$this->TransCommit();
		return 0;
	}
	public function ApiRegister(&$pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//-- ------ ### ------ --
		$tmpINT=$this->checkSKFCQWEJXVNSJL();
		if ($tmpINT!=0) {
			$this->sysLastError='对不起，您使用的是网集软件免费版本，用户数不能超过'.$this->sKASDJI83VKJSDFKJSD.'位';
			return $this->sysErrorFuncID.'001';
		}
		
		$this->TransStart();
		//-- ------ #Check register able ------ --
		if($this->sysFileConfig['userUserRegAble']==0){
			$this->sysLastError='用户注册失败:本平台不允许新用户注册，请与管理员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Reg user ------ --
		//#Check uitName repeat
		$tmpSQL=' SELECT uitID 
			FROM {Nets.TableHead}netsuserinfo 
			WHERE uitLoginAPI_ID LIKE \'{Nets.APIID}\' AND uitLoginAPI_Type={Nets.APITYPE} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.APIID}',$pDescriptions[0]['Columns']['uitLoginAPI_ID']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.APITYPE}',$pDescriptions[0]['Columns']['uitLoginAPI_Type']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)>0){
			$this->sysLastError='用户注册失败:您的帐号已经在本系统注册，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//#Check uitName repeat
		$tmpSQL=' SELECT uitID FROM '.$this->sysTableHead.'netsuserinfo WHERE uitName LIKE \''.$pDescriptions[0]['Columns']['uitName']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError='用户注册失败:您所注册的用户名已经被使用，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		/*
		//#Check uitEmail repeat
		$tmpSQL=' SELECT uitID FROM '.$this->sysTableHead.'netsuserinfo WHERE uitEmail LIKE \''.$pDescriptions[0]['Columns']['uitEmail']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError='用户注册失败:您所注册所用户使用的电子邮箱已经被使用，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		//#Check uitMobile repeat
		$tmpSQL=' SELECT uitID FROM '.$this->sysTableHead.'netsuserinfo WHERE uitMobile LIKE \''.$pDescriptions[0]['Columns']['uitMobile']['Value'].'\' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$this->sysLastError='用户注册失败:您所注册所用户使用的手机号已经被使用，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		*/
		//#Check uitUnitid
		$tmpSQL=' SELECT uutID,uutName,uutRecycle,uutChecked FROM '.$this->sysTableHead.'netsuserunit WHERE uutID='.$pDescriptions[0]['Columns']['uitUnitid']['Value'].' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)==0){
			$this->sysLastError='用户注册失败:您所要加入的单位在系统中并不存在，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'003';
		}
		if($tmpDataCollection0[0]['uutRecycle']!=0 || $tmpDataCollection0[0]['uutChecked']<2){
			$this->sysLastError='用户注册失败:您所要加入的单位已被禁用，请与相关人员联系或更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'004';
		}
		/*
		//#Check uitDepartmentid
		$tmpSQL=' SELECT udeptID,udeptName,udeptRecycle,udeptChecked 
			FROM netsuserdepartment WHERE udeptID='.$pDescriptions[0]['Columns']['uitDepartmentid']['Value'].' ';
		$tmpDataCollection0=$this->Search($tmpSQL);
		if(count($tmpDataCollection0)==0){
			$this->sysLastError='用户注册失败:您所要加入的单位在系统中并不存在，请更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'005';
		}
		if($tmpDataCollection0[0]['udeptRecycle']!=0 || $tmpDataCollection0[0]['udeptChecked']<2){
			$this->sysLastError='用户注册失败:您所要加入的部门已被禁用，请与相关人员联系或更换后再试';
			$this->TransRollback();
			return $this->sysErrorFuncID.'006';
		}
		*/
		//#Add user
		$tmpSTR=$tmpCode->IntToTime_T($tmpCode->TimeToInt_T(date($this->sysTimeFormat))+$this->sysFileConfig['userRegisterPassTime']);
		$pDescriptions[0]['Columns']['uitPassTime']['Value']=$tmpSTR;
		//-- #Check --
		$pDescriptions[0]['Columns']['uitChecked']['Value']=2;
		$pDescriptions[0]['Columns']['uitState']['Value']=0;
		
		$tmpSTR='uitNumCode';
		$pDescriptions[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$pDescriptions[0]['Columns'][$tmpSTR]['Value']='User'.date('YmdHis');
		$tmpINT=$this->numCode($pDescriptions[0]);
		
		$tmpDescription=array();
		$tmpDescription[0]=$pDescriptions[0];
		$tmpDescription[1]=$pDescriptions[1];
		$tmpDescription[0]['Columns']['uitPxd']['Value']=$tmpCode->SamplePxd($pDescriptions[0]['Columns']['uitPxd']['Value']);
		$tmpDescription[0]['TableDescription']['SearchColumn']='uitNumCode,uitID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='uictIndexID';
		$tmpINT=$this->add($tmpDescription);
		if($tmpINT!=0){
			$this->sysLastError='用户注册失败:注册用户时出错，请稍后再试';
			$this->TransRollback();
			return $tmpINT;
		}

		$this->TransCommit();
		return 0;
	}
	public function Login(&$pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		//-- ------ ### ------ --
		$tmpCode=new netsCode();
		$this->TransStart();
		//-- ------ # ------ --
		$tmpCheck=0;
		$tmpColumnName='';
		$tmpErrorMessage='';
		//#Check uitMobile
		$tmpSQL=' SELECT A.uitID
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitMobile LIKE \'{Nets.Name}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)!=1){
			$tmpErrorMessage='用户登陆失败:您的手机号码并不存在';
		}else {
			$tmpCheck=1;
			$tmpColumnName='uitMobile';
		}
		//#Check uitEmail
		$tmpSQL=' SELECT A.uitID
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitEmail LIKE \'{Nets.Name}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)!=1){
			$tmpErrorMessage='用户登陆失败:您的邮箱地址不存在';
		}else {
			$tmpCheck=1;
			$tmpColumnName='uitEmail';
		}
		//#Check uitName
		$tmpSQL=' SELECT A.uitID
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitName LIKE \'{Nets.Name}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)!=1){
			$tmpErrorMessage='用户登陆失败:用户不存在';
		}else {
			$tmpCheck=1;
			$tmpColumnName='uitName';
		}
		//-- #Check --
		if ($tmpCheck==0) {
			$this->sysLastError=$tmpErrorMessage;
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		
		//#Check uitPxd
		$pDescriptions[0]['Columns']['uitPxd']['Value']=$tmpCode->SamplePxd($pDescriptions[0]['Columns']['uitPxd']['Value']);
		$tmpSQL=' SELECT A.uitID,A.uitNumCode
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND uitRecycle=0 AND A.{Nets.ColumnsName} LIKE \'{Nets.Name}\' AND A.uitPxd LIKE \'{Nets.Pxd}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ColumnsName}',$tmpColumnName,$tmpSTR);
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Pxd}',$pDescriptions[0]['Columns']['uitPxd']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)!=1){
			$this->sysLastError='用户登陆失败:密码错误';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		$pDescriptions[0]['Columns']['uitID']['Value']=$tmpData0[0]['uitID'];
		$pDescriptions[0]['Columns']['uitNumCode']['Value']=$tmpData0[0]['uitNumCode'];
		//-- ------ #Check ------ --
		$tmpINT=$this->CheckPower($pDescriptions,1);
		if($tmpINT!=0){
			$this->TransRollback();
			return $tmpINT;
		}
		//-- ------ #Update ------ --
		$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfo SET uitOnlineState={Nets.OnlineState}
			WHERE 1=1 AND uitID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		if($pDescriptions[0]['Columns']['uitOnlineState']['Value']!=0){
			$tmpSTR=str_replace('{Nets.OnlineState}',$pDescriptions[0]['Columns']['uitOnlineState']['Value'],$tmpSTR);
		}else {
			$tmpSTR=str_replace('{Nets.OnlineState}',1,$tmpSTR);
		}
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if($tmpINT!=0){
			$this->sysLastError='用户登陆失败:更新用户状态时出错，请稍后再试或与管理员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Write cookie ------ --
		$tmpINT=$this->WriteUserinfo($pDescriptions);
		if($tmpINT!=0){
			$this->TransRollback();
			return $tmpINT;
		}
		//-- ------ #Write daily ------ --
		$tmpDescription=array(
			$this->sDbDescriptions_Other[0],
			$this->sDbDescriptions_Other[1],);
		//#Get numCode
		$tmpSTR='udtNumCode';
		$tmpDescription[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$tmpDescription[0]['Columns'][$tmpSTR]['Value']='N_'.date('YmdHis');
		$this->numCode($tmpDescription[0]);

		$tmpSTR=$tmpDescription[1]['Columns']['udctIntroduct']['Value'];
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Unit}',$pDescriptions[2]['Columns']['uutName']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Type}',$pDescriptions[4]['Columns']['uttName']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Group}',$pDescriptions[8]['Columns']['ugtName']['Value'],$tmpSTR);
		$tmpAR0=explode($this->sysSPLIT4,$tmpSTR);
		$tmpDescription[0]['Columns']['udtName']['Value']=$tmpAR0[0];
		$tmpDescription[1]['Columns']['udctIntroduct']['Value']=$tmpSTR;
		$tmpDescription[0]['Columns']['udtCreateTime']['Value']=date($this->sysTimeFormat);

		$tmpDescription[0]['TableDescription']['SearchColumn']='udtNumCode,udtID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='udctIndexID';
		$tmpINT=$this->add($tmpDescription);
		if($tmpINT!=0){
			$this->sysLastError='用户登陆失败:生成日志时出错，请稍后再试或与管理员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}

		$this->TransCommit();
		return 0;
	}
	public function Login_Api(&$pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		//-- ------ ### ------ --
		$tmpCode=new netsCode();
		$this->TransStart();
		//-- ------ # ------ --
		//-- #Check --
		$tmpSQL=' SELECT uitID,uitNumCode
			FROM {Nets.TableHead}netsuserinfo 
			WHERE uitLoginAPI_ID LIKE \'{Nets.APIID}\' AND uitLoginAPI_Type={Nets.APITYPE} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.APIID}',$pDescriptions[0]['Columns']['uitLoginAPI_ID']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.APITYPE}',$pDescriptions[0]['Columns']['uitLoginAPI_Type']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)>0){
		}else {
			$this->TransRollback();
			return 10;
		}
		//-- #LOGIN --
		$pDescriptions[0]['Columns']['uitID']['Value']=$tmpData0[0]['uitID'];
		$pDescriptions[0]['Columns']['uitNumCode']['Value']=$tmpData0[0]['uitNumCode'];
		//-- ------ #Check ------ --
		$tmpINT=$this->CheckPower($pDescriptions,1);
		if($tmpINT!=0){
			$this->TransRollback();
			return $tmpINT;
		}
		//-- ------ #Update ------ --
		$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfo SET uitOnlineState={Nets.OnlineState}
			WHERE 1=1 AND uitID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			if($pDescriptions[0]['Columns']['uitOnlineState']['Value']!=0){
				$tmpSTR=str_replace('{Nets.OnlineState}',$pDescriptions[0]['Columns']['uitOnlineState']['Value'],$tmpSTR);
			}else {
				$tmpSTR=str_replace('{Nets.OnlineState}',1,$tmpSTR);
			}
			$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			if($tmpINT!=0){
				$this->sysLastError='用户登陆失败:更新用户状态时出错，请稍后再试或与管理员联系。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Write cookie ------ --
		$tmpINT=$this->WriteUserinfo($pDescriptions);
		if($tmpINT!=0){
			$this->TransRollback();
			return $tmpINT;
		}
		//-- ------ #Write daily ------ --
		$tmpDescription=array(
			$this->sDbDescriptions_Other[0],
			$this->sDbDescriptions_Other[1],);
		//#Get numCode
		$tmpSTR='udtNumCode';
		$tmpDescription[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$tmpDescription[0]['Columns'][$tmpSTR]['Value']='N_'.date('YmdHis');
		$this->numCode($tmpDescription[0]);

		$tmpSTR=$tmpDescription[1]['Columns']['udctIntroduct']['Value'];
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Unit}',$pDescriptions[2]['Columns']['uutName']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Type}',$pDescriptions[4]['Columns']['uttName']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Group}',$pDescriptions[8]['Columns']['ugtName']['Value'],$tmpSTR);
		$tmpAR0=explode($this->sysSPLIT4,$tmpSTR);
		$tmpDescription[0]['Columns']['udtName']['Value']=$tmpAR0[0];
		$tmpDescription[1]['Columns']['udctIntroduct']['Value']=$tmpSTR;
		$tmpDescription[0]['Columns']['udtCreateTime']['Value']=date($this->sysTimeFormat);

		$tmpDescription[0]['TableDescription']['SearchColumn']='udtNumCode,udtID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='udctIndexID';
		$tmpINT=$this->add($tmpDescription);
		if($tmpINT!=0){
			$this->sysLastError='用户登陆失败:生成日志时出错，请稍后再试或与管理员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		
		$this->TransCommit();
		return 0;
	}
	public function Logout(&$pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$this->TransStart();
		//-- ------ #Write daily ------ --
		$tmpDescription=array($this->sDbDescriptions_Other[0][0],
			$this->sDbDescriptions_Other[0][1],);
		//#Get numCode
		$tmpSTR='udtNumCode';
		$tmpDescription[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$tmpDescription[0]['Columns'][$tmpSTR]['Value']='N_'.date('YmdHis');
		$this->numCode($tmpDescription[0]);

		$tmpDescription[0]['Columns']['udtCreateTime']['Value']=date($this->sysTimeFormat);

		$tmpDescription[0]['TableDescription']['SearchColumn']='udtNumCode,udtID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='udctIndexID';
		$tmpINT=$this->add($tmpDescription);
		//-- ------ #Logout ------ --
		$this->writeCookie($this->sysNormalCookiePath,$this->sysCookieHead.$this->sysManaCookieName,'');
		
		$this->TransCommit();
		return 0;
	}
	public function CheckPower(&$pDescriptions,$pType){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//#Check checked,netsuserunit,netsusergroup,netsusertype
		$tmpSQL=' SELECT
A.uitID,A.uitName,A.uitNumCode,
A.uitUnitid,A.uitDepartmentid,A.uitPositionid,A.uitTypeid,A.uitGradeid,A.uitGroupid,A.uitParentid,
A.uitRecycle,A.uitChecked,A.uitCreateTime,A.uitPassTime,A.uitEmail,A.uitMobile,A.uitPxd,A.uitMoney,A.uitCode,A.uitNickname,A.uitOnlineState,A.uitLoginNumcode,A.uitInterfaceNumcode,A.uitLoginAPI_Type,
B.uictCo_Name,B.uictCo_Sex,B.uictCo_Tele,B.uictCo_Mobile,B.uictCo_Fax,B.uictCo_Software,B.uictCo_Website,B.uictCo_NumCode,
B.uictModelid_Detail,B.uictTemplateid_Detail,
B.uictTemplatepath_Unit,B.uictTemplatepath_Shop,B.uictTemplatepath_Blog,B.uictTemplatepath_Microblogging,
B.uictPayAlipay,B.uictPayChinabank,B.uictPayTenpay,B.uictPay99Bill,B.uictPayYeepay,B.uictPayPaypal,B.uictPayType,
B.uictPayCode,B.uictPayBankCode,B.uictPayBankName,B.uictPayBankUName,B.uictPayBankAddress,B.uictPayBankCountry,
B.uictPayBankCountryCode,B.uictEmailSmtpIp,B.uictEmailSmtpPort,B.uictEmailSmtpName,B.uictEmailSmtpPxd,B.uictEmailPop3Able,
B.uictEmailPop3Ip,B.uictEmailPop3Port,B.uictEmailPop3Name,B.uictEmailPop3Pxd,B.uictEmailImapAble,B.uictEmailImapIp,
B.uictEmailImapName,B.uictEmailImapPxd,B.uictInterface_Pxd,B.uictCount_Views,B.uictCount_Reply,B.uictCode_Main,
B.uictCode_Positive,B.uictCode_Negative,B.uictChecked_Mobile,B.uictChecked_Postcode,B.uictChecked_Bank,
B.uictChecked_Email,B.uictChecked_Pay,B.uictPower_View,B.uictPower_ColumnsView,B.uictSourceR00,

C.uutID,C.uutName,C.uutNumCode,C.uutRecycle,C.uutChecked,C.uutPassTime,
D.uuctSysConfig,
E.uttID,E.uttName,E.uttRecycle,E.uttChecked,E.uttType,E.uttSign,
F.utctPower_Menu_Mana,F.utctPower_Menu_Platform,F.utctPower_Menu_QPlatform,F.utctPower_Menu_User,
G.udeptID,G.udeptName,G.udeptRecycle,G.udeptChecked,G.udeptPassTime,
J.ugtID,J.ugtName,J.ugtRecycle,J.ugtChecked,
K.ugratID
FROM ((((((((({Nets.TableHead}netsuserinfo AS A
INNER JOIN {Nets.TableHead}netsuserinfocont AS B ON B.uictIndexID=A.uitID)
INNER JOIN {Nets.TableHead}netsuserunit AS C ON C.uutID=A.uitUnitid)
INNER JOIN {Nets.TableHead}netsuserunitcont AS D ON D.uuctIndexID=C.uutID)
INNER JOIN {Nets.TableHead}netsusertype AS E ON E.uttID=A.uitTypeid)
INNER JOIN {Nets.TableHead}netsusertypecont AS F ON F.utctIndexID=E.uttID)
LEFT OUTER JOIN {Nets.TableHead}netsuserdepartment AS G ON G.udeptID=A.uitDepartmentid)
LEFT OUTER JOIN {Nets.TableHead}netsuserdepartmentcont AS H ON H.udepctIndexID=G.udeptID)
LEFT OUTER JOIN {Nets.TableHead}netsusergroup AS J ON J.ugtID=A.uitGroupid)
LEFT OUTER JOIN {Nets.TableHead}netsusergrade AS K ON K.ugratID=A.uitGradeid)
WHERE 1=1 AND A.uitNumCode LIKE \'{Nets.NumCode}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.NumCode}',$pDescriptions[0]['Columns']['uitNumCode']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)!=1){
			$this->sysLastError='用户登陆失败';
			return $this->sysErrorFuncID.'003';
		}
		if($tmpData0[0]['uitLoginNumcode']!=$pDescriptions[0]['Columns']['uitLoginNumcode']['Value'] && $pType==0){
			$this->sysLastError='用户登陆失败:用户验证失败';
			return $this->sysErrorFuncID.'004';
		}
		//-- ------ #Set LoginNumcode ------ --
		if($this->sysFileConfig['LoginRepeateAble']==0 && $pType==1){
			//Can not repeate
			$tmpData0[0]['uitLoginNumcode']=$pDescriptions[0]['Columns']['uitLoginNumcode']['Value']=$tmpCode->TimeToInt(date($this->sysTimeFormat));
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfo 
				SET uitLoginNumcode=\'{Nets.Numcode}\'
				WHERE 1=1 AND uitID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Numcode}',$pDescriptions[0]['Columns']['uitLoginNumcode']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			if($tmpINT!=0){
				$this->sysLastError='用户登陆失败:设置加密码错误';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
		}
		if($tmpData0[0]['uitRecycle']!=0 || $tmpData0[0]['uitChecked']<2){
			$this->sysLastError='用户登陆失败:您的用户可能已经被禁用';
			$this->TransRollback();
			return $this->sysErrorFuncID.'004';
		}
		if($tmpData0[0]['uitPassTime']<date($this->sysTimeFormat)){
			$this->sysLastError='用户登陆失败:您的用户已经到期';
			$this->TransRollback();
			return $this->sysErrorFuncID.'005';
		}
		if($tmpData0[0]['uttRecycle']!=0 || $tmpData0[0]['uttChecked']<2){
			$this->sysLastError='用户登陆失败:您用户所在的用户分类可能已经被禁用';
			$this->TransRollback();
			return $this->sysErrorFuncID.'006';
		}
		if($tmpData0[0]['uutRecycle']!=0 || $tmpData0[0]['uutChecked']<2){
			$this->sysLastError='用户登陆失败:您用户所在的单位可能已经被禁用';
			$this->TransRollback();
			return $this->sysErrorFuncID.'007';
		}
		if($tmpData0[0]['uutPassTime']<date($this->sysTimeFormat)){
			$this->sysLastError='用户登陆失败:您用户所在的单位已经到期';
			$this->TransRollback();
			return $this->sysErrorFuncID.'008';
		}
		/*
		if($tmpDataCollection0[0]['udeptRecycle']!=0 || $tmpDataCollection0[0]['udeptChecked']<2){
			$this->sysLastError='用户登陆失败:您用户所在的部门可能已经被禁用';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		if($tmpDataCollection0[0]['udeptPassTime']<date($this->sysTimeFormat)){
			$this->sysLastError='用户登陆失败:您用户所在的部门已经到期';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		*/
		$tmpAR0=explode($this->sysSPLIT1,$pDescriptions[4]['Columns']['uttType']['Value']);
		array_pop($tmpAR0);
		if(!in_array($tmpData0[0]['uttType'],$tmpAR0)){
			$this->sysLastError='用户登陆失败:您所在的用户分类下的用户不能在这里登陆';
			$this->TransRollback();
			return $this->sysErrorFuncID.'009';
		}
		//-- ------ #Set value ------ --
		//netsuserinfo
		$Coun0=0;
		$tmpAR0=array('uitID','uitName','uitNumCode','uitUnitid','uitDepartmentid','uitPositionid','uitGradeid','uitGroupid','uitTypeid','uitParentid',
			'uitRecycle','uitChecked','uitCreateTime','uitPassTime','uitEmail','uitPxd','uitMoney','uitCode','uitNickname','uitOnlineState','uitLoginNumcode','uitInterfaceNumcode','uitLoginAPI_Type',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsuserinfocont
		$Coun0=1;
		$tmpAR0=array('uictModelid_Detail','uictTemplateid_Detail','uictSourceR00','uictPayAlipay','uictPayChinabank','uictPayTenpay','uictPay99Bill','uictPayBankCode','uictPayBankName',
			'uictPayBankUName','uictPayBankAddress','uictPayBankCountry','uictPayBankCountryCode',
			'uictSourceR00','uictCo_Mobile','uictCo_Tele','uictCo_Software','uictCo_Website',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsuserunit
		$Coun0=2;
		$tmpAR0=array('uutID','uutName','uutNumCode','uutRecycle','uutChecked','uutPassTime',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsuserunitcont
		$Coun0=3;
		$tmpAR0=array('uuctSysConfig',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsusertype
		$Coun0=4;
		$tmpAR0=array('uttID','uttName','uttRecycle','uttChecked','uttType','uttSign',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsusertypecont
		$Coun0=5;
		$tmpAR0=array('utctPower_Menu_Mana','utctPower_Menu_Platform','utctPower_Menu_QPlatform','utctPower_Menu_User',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsuserdepartment
		$Coun0=6;
		$tmpAR0=array('udeptID','udeptName','udeptRecycle','udeptChecked','udeptPassTime',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsusergroup
		$Coun0=8;
		$tmpAR0=array('ugtID','ugtName','ugtRecycle','ugtChecked',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsusergrade
		$Coun0=9;
		$tmpAR0=array('ugratID',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		
		return 0;
	}
	public function ReadUserinfo(&$pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//-- ------ #Cookie ------ --
		$tmpCOOKIE=$this->readCookie($this->sysCookieHead.$this->sysManaCookieName);
		$tmpAR0=explode($this->sysSPLIT1,$tmpCOOKIE);
		if(count($tmpAR0)!=3){
			$this->sysLastError='用户登陆失败：用户验证失败。';
			return $this->sysErrorFuncID.'001';
		}
		$pDescriptions[0]['Columns']['uitNumCode']['Value']=$tmpAR0[0];
		$pDescriptions[0]['Columns']['uitLoginNumcode']['Value']=$tmpAR0[1];
		$tmpINT=$this->CheckPower($pDescriptions,0);
		if($tmpINT!=0){
			return $tmpINT;
		}
		$tmpSTR=$pDescriptions[0]['Columns']['uitNumCode']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitLoginNumcode']['Value'].$this->sysSPLIT1.
			$tmpCode->SamplePxd($tmpCode->SamplePxd(
			$pDescriptions[0]['Columns']['uitID']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitName']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitPxd']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitNumCode']['Value'].$this->sysSPLIT1.
			$this->sysFileConfig['coreKeyword']).$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitLoginNumcode']['Value']
			);
		if($tmpSTR!=$tmpCOOKIE){
			$this->sysLastError='用户登陆失败：用户验证失败。';
			return $this->sysErrorFuncID.'001';
		}

		return 0;
	}
	public function WriteUserinfo(&$pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//-- ------ # ------ --
		/*
		uitNumCode,uitLoginNumcode,MD5(MD5(uitID,uitName,uitPxd,uitNumCode,coreKeyword),uitLoginNumcode)
		*/
		$tmpSTR=$pDescriptions[0]['Columns']['uitNumCode']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitLoginNumcode']['Value'].$this->sysSPLIT1.
			$tmpCode->SamplePxd($tmpCode->SamplePxd(
			$pDescriptions[0]['Columns']['uitID']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitName']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitPxd']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitNumCode']['Value'].$this->sysSPLIT1.
			$this->sysFileConfig['coreKeyword']).$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitLoginNumcode']['Value']
			);
		$this->writeCookie($this->sysNormalCookiePath,$this->sysCookieHead.$this->sysManaCookieName,$tmpSTR);
		
		return 0;
	}
	public function CheckPower_Interface(&$pDescriptions,$pURL){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//#Check checked,netsuserunit,netsusergroup,netsusertype
		$tmpSQL=' SELECT
A.uitID,A.uitName,A.uitNumCode,
A.uitUnitid,A.uitDepartmentid,A.uitPositionid,A.uitTypeid,A.uitGradeid,A.uitGroupid,A.uitParentid,
A.uitRecycle,A.uitChecked,A.uitCreateTime,A.uitPassTime,A.uitEmail,A.uitMobile,A.uitPxd,A.uitMoney,A.uitCode,A.uitNickname,A.uitOnlineState,A.uitLoginNumcode,A.uitInterfaceNumcode,A.uitLoginAPI_Type,
B.uictCo_Name,B.uictCo_Sex,B.uictCo_Tele,B.uictCo_Mobile,B.uictCo_Fax,B.uictCo_Software,B.uictCo_Website,B.uictCo_NumCode,
B.uictModelid_Detail,B.uictTemplateid_Detail,
B.uictTemplatepath_Unit,B.uictTemplatepath_Shop,B.uictTemplatepath_Blog,B.uictTemplatepath_Microblogging,
B.uictPayAlipay,B.uictPayChinabank,B.uictPayTenpay,B.uictPay99Bill,B.uictPayYeepay,B.uictPayPaypal,B.uictPayType,
B.uictPayCode,B.uictPayBankCode,B.uictPayBankName,B.uictPayBankUName,B.uictPayBankAddress,B.uictPayBankCountry,
B.uictPayBankCountryCode,B.uictEmailSmtpIp,B.uictEmailSmtpPort,B.uictEmailSmtpName,B.uictEmailSmtpPxd,B.uictEmailPop3Able,
B.uictEmailPop3Ip,B.uictEmailPop3Port,B.uictEmailPop3Name,B.uictEmailPop3Pxd,B.uictEmailImapAble,B.uictEmailImapIp,
B.uictEmailImapName,B.uictEmailImapPxd,B.uictInterface_Pxd,B.uictCount_Views,B.uictCount_Reply,B.uictCode_Main,
B.uictCode_Positive,B.uictCode_Negative,B.uictChecked_Mobile,B.uictChecked_Postcode,B.uictChecked_Bank,
B.uictChecked_Email,B.uictChecked_Pay,B.uictPower_View,B.uictPower_ColumnsView,B.uictSourceR00,

C.uutID,C.uutName,C.uutNumCode,C.uutRecycle,C.uutChecked,C.uutPassTime,
D.uuctSysConfig,
E.uttID,E.uttName,E.uttRecycle,E.uttChecked,E.uttType,E.uttSign,
F.utctPower_Menu_Mana,F.utctPower_Menu_Platform,F.utctPower_Menu_QPlatform,F.utctPower_Menu_User,
G.udeptID,G.udeptName,G.udeptRecycle,G.udeptChecked,G.udeptPassTime,
J.ugtID,J.ugtName,J.ugtRecycle,J.ugtChecked,
K.ugratID
FROM ((((((((({Nets.TableHead}netsuserinfo AS A
INNER JOIN {Nets.TableHead}netsuserinfocont AS B ON B.uictIndexID=A.uitID)
INNER JOIN {Nets.TableHead}netsuserunit AS C ON C.uutID=A.uitUnitid)
INNER JOIN {Nets.TableHead}netsuserunitcont AS D ON D.uuctIndexID=C.uutID)
INNER JOIN {Nets.TableHead}netsusertype AS E ON E.uttID=A.uitTypeid)
INNER JOIN {Nets.TableHead}netsusertypecont AS F ON F.utctIndexID=E.uttID)
LEFT OUTER JOIN {Nets.TableHead}netsuserdepartment AS G ON G.udeptID=A.uitDepartmentid)
LEFT OUTER JOIN {Nets.TableHead}netsuserdepartmentcont AS H ON H.udepctIndexID=G.udeptID)
LEFT OUTER JOIN {Nets.TableHead}netsusergroup AS J ON J.ugtID=A.uitGroupid)
LEFT OUTER JOIN {Nets.TableHead}netsusergrade AS K ON K.ugratID=A.uitGradeid)
WHERE 1=1 AND A.uitNumCode LIKE \'{Nets.NumCode}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.NumCode}',$pDescriptions[0]['Columns']['uitNumCode']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)!=1){
			$this->sysLastError='用户名或密码错误:用户名或密码错误';
			$this->TransRollback();
			return $this->sysErrorFuncID.'003';
		}
		$pDescriptions[0]['Columns']['uitID']['Value']=$tmpData0[0]['uitID'];
		//-- ------ #Set InterfaceNumcode ------ --
		if($tmpData0[0]['uitInterfaceNumcode']>=$pDescriptions[0]['Columns']['uitInterfaceNumcode']['Value'] && 1==2){
			$this->sysLastError='用户登陆失败:用户验证失败';
			$this->TransRollback();
			return $this->sysErrorFuncID.'004';
		}else {
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfo SET uitInterfaceNumcode=\'{Nets.Numcode}\'
				WHERE 1=1 AND uitID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Numcode}',$pDescriptions[0]['Columns']['uitInterfaceNumcode']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			if($tmpINT!=0){
				$this->sysLastError='设置加密码错误:设置加密码错误';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			$tmpData0[0]['uitInterfaceNumcode']=$pDescriptions[0]['Columns']['uitInterfaceNumcode']['Value'];
		}
		if($tmpData0[0]['uitRecycle']!=0 || $tmpData0[0]['uitChecked']<2){
			$this->sysLastError='用户登陆失败:您的用户可能已经被禁用';
			$this->TransRollback();
			return $this->sysErrorFuncID.'004';
		}
		if($tmpData0[0]['uitPassTime']<date($this->sysTimeFormat)){
			$this->sysLastError='用户登陆失败:您的用户已经到期';
			$this->TransRollback();
			return $this->sysErrorFuncID.'005';
		}
		if($tmpData0[0]['uttRecycle']!=0 || $tmpData0[0]['uttChecked']<2){
			$this->sysLastError='用户登陆失败:您用户所在的用户分类可能已经被禁用';
			$this->TransRollback();
			return $this->sysErrorFuncID.'006';
		}
		if($tmpData0[0]['uutRecycle']!=0 || $tmpData0[0]['uutChecked']<2){
			$this->sysLastError='用户登陆失败:您用户所在的单位可能已经被禁用';
			$this->TransRollback();
			return $this->sysErrorFuncID.'007';
		}
		if($tmpData0[0]['uutPassTime']<date($this->sysTimeFormat)){
			$this->sysLastError='用户登陆失败:您用户所在的单位已经到期';
			$this->TransRollback();
			return $this->sysErrorFuncID.'008';
		}
		/*
		if($tmpDataCollection0[0]['udeptRecycle']!=0 || $tmpDataCollection0[0]['udeptChecked']<2){
			$this->sysLastError='用户登陆失败:您用户所在的部门可能已经被禁用';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		if($tmpDataCollection0[0]['udeptPassTime']<date($this->sysTimeFormat)){
			$this->sysLastError='用户登陆失败:您用户所在的部门已经到期';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		*/
		$tmpAR0=explode($this->sysSPLIT1,$pDescriptions[4]['Columns']['uttType']['Value']);
		array_pop($tmpAR0);
		if(!in_array($tmpData0[0]['uttType'],$tmpAR0)){
			$this->sysLastError='用户登陆失败:您所在的用户分类下的用户不能在这里登陆';
			$this->TransRollback();
			return $this->sysErrorFuncID.'009';
		}
		//-- ------ #Set value ------ --
		//netsuserinfo
		$Coun0=0;
		$tmpAR0=array('uitID','uitName','uitNumCode','uitUnitid','uitDepartmentid','uitPositionid','uitGradeid','uitGroupid','uitTypeid','uitParentid',
			'uitRecycle','uitChecked','uitCreateTime','uitPassTime','uitEmail','uitPxd','uitMoney','uitCode','uitNickname','uitOnlineState','uitLoginNumcode','uitInterfaceNumcode','uitLoginAPI_Type',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsuserinfocont
		$Coun0=1;
		$tmpAR0=array('uictModelid_Detail','uictTemplateid_Detail','uictSourceR00','uictPayAlipay','uictPayChinabank','uictPayTenpay','uictPay99Bill','uictPayBankCode','uictPayBankName',
			'uictPayBankUName','uictPayBankAddress','uictPayBankCountry','uictPayBankCountryCode',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsuserunit
		$Coun0=2;
		$tmpAR0=array('uutID','uutName','uutNumCode','uutRecycle','uutChecked','uutPassTime',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsuserunitcont
		$Coun0=3;
		$tmpAR0=array('uuctSysConfig',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsusertype
		$Coun0=4;
		$tmpAR0=array('uttID','uttName','uttRecycle','uttChecked','uttType','uttSign',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsusertypecont
		$Coun0=5;
		$tmpAR0=array('utctPower_Menu_Mana','utctPower_Menu_Platform','utctPower_Menu_QPlatform','utctPower_Menu_User',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsuserdepartment
		$Coun0=6;
		$tmpAR0=array('udeptID','udeptName','udeptRecycle','udeptChecked','udeptPassTime',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsusergroup
		$Coun0=8;
		$tmpAR0=array('ugtID','ugtName','ugtRecycle','ugtChecked',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsusergrade
		$Coun0=9;
		$tmpAR0=array('ugratID',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//-- ------ #CODE ------ --
		$tmpSTR=$pDescriptions[0]['Columns']['uitNumCode']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitInterfaceNumcode']['Value'].$this->sysSPLIT1.
			$tmpCode->SamplePxd($tmpCode->SamplePxd(
			$pDescriptions[0]['Columns']['uitID']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitName']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitPxd']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitNumCode']['Value'].$this->sysSPLIT1.
			$this->sysFileConfig['coreKeyword']).$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitInterfaceNumcode']['Value']
			);
		if($tmpSTR==$pURL){
			$this->sysLastError='用户验证成功。';
			$this->TransRollback();
			return 0;
		}
		
		return 0;
	}
	public function ReadUserinfo_Interface(&$pDescriptions,$pURL,$pPOST){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$this->TransStart();
		$tmpCode=new netsCode();
		//-- ------ #URL ------ --
		$tmpAR0=explode($this->sysSPLIT1,$pURL);
		if(count($tmpAR0)==3){
			$pDescriptions[0]['Columns']['uitNumCode']['Value']=$tmpAR0[0];
			$pDescriptions[0]['Columns']['uitInterfaceNumcode']['Value']=$tmpAR0[1];
			$tmpINT=$this->CheckPower_Interface($pDescriptions,$pURL);
			if($tmpINT==0){
				$this->sysLastError='用户验证成功。';
				$this->TransRollback();
				return 0;
			}else {
				$this->sysLastError='用户验证失败。';
				$this->TransRollback();
				return 1;
			}
			
		}else {
			$this->sysLastError='用户验证失败。';
			$this->TransRollback();
		}
		//-- ------ #POST ------ --
		$tmpAR0=explode($this->sysSPLIT1,$pPOST);
		if(count($tmpAR0)==3){
			$pDescriptions[0]['Columns']['uitNumCode']['Value']=$tmpAR0[0];
			$pDescriptions[0]['Columns']['uitInterfaceNumcode']['Value']=$tmpAR0[1];
			$tmpINT=$this->CheckPower_Interface($pDescriptions,$pPOST);
			if($tmpINT==0){
				$this->sysLastError='用户验证成功。';
				$this->TransRollback();
				return 0;
			}else {
				$this->sysLastError='用户验证失败。';
				$this->TransRollback();
				return 1;
			}
			
		}else {
			$this->sysLastError='用户验证失败。';
			$this->TransRollback();
		}
		
		$this->TransCommit();
		return 1;
	}
	public function CheckPower_Interface_Login(&$pDescriptions,$pPID,$pURL){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//#Check checked,netsuserunit,netsusergroup,netsusertype
		$tmpSQL=' SELECT
A.uitID,A.uitName,A.uitNumCode,
A.uitUnitid,A.uitDepartmentid,A.uitPositionid,A.uitTypeid,A.uitGradeid,A.uitGroupid,A.uitParentid,
A.uitRecycle,A.uitChecked,A.uitCreateTime,A.uitPassTime,A.uitEmail,A.uitMobile,A.uitPxd,A.uitMoney,A.uitCode,A.uitNickname,A.uitOnlineState,A.uitLoginNumcode,A.uitInterfaceNumcode,A.uitLoginAPI_Type,
B.uictCo_Name,B.uictCo_Sex,B.uictCo_Tele,B.uictCo_Mobile,B.uictCo_Fax,B.uictCo_Software,B.uictCo_Website,B.uictCo_NumCode,
B.uictModelid_Detail,B.uictTemplateid_Detail,
B.uictTemplatepath_Unit,B.uictTemplatepath_Shop,B.uictTemplatepath_Blog,B.uictTemplatepath_Microblogging,
B.uictPayAlipay,B.uictPayChinabank,B.uictPayTenpay,B.uictPay99Bill,B.uictPayYeepay,B.uictPayPaypal,B.uictPayType,
B.uictPayCode,B.uictPayBankCode,B.uictPayBankName,B.uictPayBankUName,B.uictPayBankAddress,B.uictPayBankCountry,
B.uictPayBankCountryCode,B.uictEmailSmtpIp,B.uictEmailSmtpPort,B.uictEmailSmtpName,B.uictEmailSmtpPxd,B.uictEmailPop3Able,
B.uictEmailPop3Ip,B.uictEmailPop3Port,B.uictEmailPop3Name,B.uictEmailPop3Pxd,B.uictEmailImapAble,B.uictEmailImapIp,
B.uictEmailImapName,B.uictEmailImapPxd,B.uictInterface_Pxd,B.uictCount_Views,B.uictCount_Reply,B.uictCode_Main,
B.uictCode_Positive,B.uictCode_Negative,B.uictChecked_Mobile,B.uictChecked_Postcode,B.uictChecked_Bank,
B.uictChecked_Email,B.uictChecked_Pay,B.uictPower_View,B.uictPower_ColumnsView,B.uictSourceR00,

C.uutID,C.uutName,C.uutNumCode,C.uutRecycle,C.uutChecked,C.uutPassTime,
D.uuctSysConfig,
E.uttID,E.uttName,E.uttRecycle,E.uttChecked,E.uttType,E.uttSign,
F.utctPower_Menu_Mana,F.utctPower_Menu_Platform,F.utctPower_Menu_QPlatform,F.utctPower_Menu_User,
G.udeptID,G.udeptName,G.udeptRecycle,G.udeptChecked,G.udeptPassTime,
J.ugtID,J.ugtName,J.ugtRecycle,J.ugtChecked,
K.ugratID
FROM ((((((((({Nets.TableHead}netsuserinfo AS A
INNER JOIN {Nets.TableHead}netsuserinfocont AS B ON B.uictIndexID=A.uitID)
INNER JOIN {Nets.TableHead}netsuserunit AS C ON C.uutID=A.uitUnitid)
INNER JOIN {Nets.TableHead}netsuserunitcont AS D ON D.uuctIndexID=C.uutID)
INNER JOIN {Nets.TableHead}netsusertype AS E ON E.uttID=A.uitTypeid)
INNER JOIN {Nets.TableHead}netsusertypecont AS F ON F.utctIndexID=E.uttID)
LEFT OUTER JOIN {Nets.TableHead}netsuserdepartment AS G ON G.udeptID=A.uitDepartmentid)
LEFT OUTER JOIN {Nets.TableHead}netsuserdepartmentcont AS H ON H.udepctIndexID=G.udeptID)
LEFT OUTER JOIN {Nets.TableHead}netsusergroup AS J ON J.ugtID=A.uitGroupid)
LEFT OUTER JOIN {Nets.TableHead}netsusergrade AS K ON K.ugratID=A.uitGradeid)
WHERE 1=1 AND A.uitName LIKE \'{Nets.Name}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)!=1){
			$this->sysLastError='用户名或密码错误:用户名或密码错误';
			$this->TransRollback();
			return $this->sysErrorFuncID.'003';
		}
		$pDescriptions[0]['Columns']['uitID']['Value']=$tmpData0[0]['uitID'];
		//-- ------ #Set InterfaceNumcode ------ --
		if($tmpData0[0]['uitInterfaceNumcode']>=$pDescriptions[0]['Columns']['uitInterfaceNumcode']['Value'] && 1==2){
			$this->sysLastError='用户登陆失败:用户验证失败';
			$this->TransRollback();
			return $this->sysErrorFuncID.'004';
		}else {
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfo SET uitInterfaceNumcode=\'{Nets.Numcode}\'
				WHERE 1=1 AND uitID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Numcode}',$pDescriptions[0]['Columns']['uitInterfaceNumcode']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			if($tmpINT!=0){
				$this->sysLastError='设置加密码错误:设置加密码错误';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			$tmpData0[0]['uitInterfaceNumcode']=$pDescriptions[0]['Columns']['uitInterfaceNumcode']['Value'];
		}
		if($tmpData0[0]['uitRecycle']!=0 || $tmpData0[0]['uitChecked']<2){
			$this->sysLastError='用户登陆失败:您的用户可能已经被禁用';
			$this->TransRollback();
			return $this->sysErrorFuncID.'004';
		}
		if($tmpData0[0]['uitPassTime']<date($this->sysTimeFormat)){
			$this->sysLastError='用户登陆失败:您的用户已经到期';
			$this->TransRollback();
			return $this->sysErrorFuncID.'005';
		}
		if($tmpData0[0]['uttRecycle']!=0 || $tmpData0[0]['uttChecked']<2){
			$this->sysLastError='用户登陆失败:您用户所在的用户分类可能已经被禁用';
			$this->TransRollback();
			return $this->sysErrorFuncID.'006';
		}
		if($tmpData0[0]['uutRecycle']!=0 || $tmpData0[0]['uutChecked']<2){
			$this->sysLastError='用户登陆失败:您用户所在的单位可能已经被禁用';
			$this->TransRollback();
			return $this->sysErrorFuncID.'007';
		}
		if($tmpData0[0]['uutPassTime']<date($this->sysTimeFormat)){
			$this->sysLastError='用户登陆失败:您用户所在的单位已经到期';
			$this->TransRollback();
			return $this->sysErrorFuncID.'008';
		}
		/*
		if($tmpDataCollection0[0]['udeptRecycle']!=0 || $tmpDataCollection0[0]['udeptChecked']<2){
			$this->sysLastError='用户登陆失败:您用户所在的部门可能已经被禁用';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		if($tmpDataCollection0[0]['udeptPassTime']<date($this->sysTimeFormat)){
			$this->sysLastError='用户登陆失败:您用户所在的部门已经到期';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		*/
		$tmpAR0=explode($this->sysSPLIT1,$pDescriptions[4]['Columns']['uttType']['Value']);
		array_pop($tmpAR0);
		if(!in_array($tmpData0[0]['uttType'],$tmpAR0)){
			$this->sysLastError='用户登陆失败:您所在的用户分类下的用户不能在这里登陆';
			$this->TransRollback();
			return $this->sysErrorFuncID.'009';
		}
		//-- ------ #Set value ------ --
		//netsuserinfo
		$Coun0=0;
		$tmpAR0=array('uitID','uitName','uitNumCode','uitUnitid','uitDepartmentid','uitPositionid','uitGradeid','uitGroupid','uitTypeid','uitParentid',
			'uitRecycle','uitChecked','uitCreateTime','uitPassTime','uitEmail','uitPxd','uitMoney','uitCode','uitNickname','uitOnlineState','uitLoginNumcode','uitInterfaceNumcode','uitLoginAPI_Type',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsuserinfocont
		$Coun0=1;
		$tmpAR0=array('uictModelid_Detail','uictTemplateid_Detail','uictSourceR00','uictPayAlipay','uictPayChinabank','uictPayTenpay','uictPay99Bill','uictPayBankCode','uictPayBankName',
			'uictPayBankUName','uictPayBankAddress','uictPayBankCountry','uictPayBankCountryCode',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsuserunit
		$Coun0=2;
		$tmpAR0=array('uutID','uutName','uutNumCode','uutRecycle','uutChecked','uutPassTime',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsuserunitcont
		$Coun0=3;
		$tmpAR0=array('uuctSysConfig',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsusertype
		$Coun0=4;
		$tmpAR0=array('uttID','uttName','uttRecycle','uttChecked','uttType','uttSign',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsusertypecont
		$Coun0=5;
		$tmpAR0=array('utctPower_Menu_Mana','utctPower_Menu_Platform','utctPower_Menu_QPlatform','utctPower_Menu_User',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsuserdepartment
		$Coun0=6;
		$tmpAR0=array('udeptID','udeptName','udeptRecycle','udeptChecked','udeptPassTime',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsusergroup
		$Coun0=8;
		$tmpAR0=array('ugtID','ugtName','ugtRecycle','ugtChecked',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//netsusergrade
		$Coun0=9;
		$tmpAR0=array('ugratID',);
		foreach ($tmpAR0 as $Cell){
			$pDescriptions[$Coun0]['Columns'][$Cell]['Value']=$tmpData0[0][$Cell];
		}
		//-- ------ #CODE ------ --
		$tmpInterface_Pxd='';
		if($pPID!=0){
			$tmpSQL=' SELECT A.uitID,B.uictInterface_Pxd
				FROM ({Nets.TableHead}netsuserinfo AS A
				INNER JOIN {Nets.TableHead}netsuserinfocont AS B ON B.uictIndexID=A.uitID)
				WHERE 1=1 AND A.uitRecycle=0 AND A.uitChecked>1 AND A.uitID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.ID}',$pPID,$tmpSTR);
			$tmpData0=$this->Search($tmpSTR);
			if(count($tmpData0)>0){
				$pPID=$tmpData0['uitID'];
				$tmpInterface_Pxd=$tmpData0['uictInterface_Pxd'];
			}
		}
		$tmpSTR=$pDescriptions[0]['Columns']['uitName']['Value'].$this->sysSPLIT1.
			$pPID.$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitInterfaceNumcode']['Value'].$this->sysSPLIT1.
			$tmpCode->SamplePxd(
				$pDescriptions[0]['Columns']['uitName']['Value'].$this->sysSPLIT1.
				$pDescriptions[0]['Columns']['uitPxd']['Value'].$this->sysSPLIT1.
				$tmpInterface_Pxd.$this->sysSPLIT1.
				$pDescriptions[0]['Columns']['uitInterfaceNumcode']['Value']
			);
		if($tmpSTR==$pURL){
			$this->sysLastError='用户验证成功。';
			$this->TransRollback();
			return 1;
		}
		
		return 0;
	}
	public function ReadUserinfo_Interface_Login(&$pDescriptions,$pURL,$pPOST){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$this->TransStart();
		$tmpCode=new netsCode();
		//-- ------ #URL ------ --
		$tmpAR0=explode($this->sysSPLIT1,$pURL);
		if(count($tmpAR0)==4){
			$pDescriptions[0]['Columns']['uitName']['Value']=$tmpAR0[0];
			$pDescriptions[0]['Columns']['uitInterfaceNumcode']['Value']=$tmpAR0[2];
			$tmpINT=$this->CheckPower_Interface_Login($pDescriptions,$tmpAR0[1],$pURL);
			if($tmpINT==0){
				$this->sysLastError='用户验证成功。';
				$this->TransRollback();
				return 0;
			}else {
				$this->sysLastError='用户验证失败。';
				$this->TransRollback();
				return 1;
			}

		}else {
			$this->sysLastError='用户验证失败。';
		}
		//-- ------ #POST ------ --
		$tmpAR0=explode($this->sysSPLIT1,$pPOST);
		if(count($tmpAR0)==4){
			$pDescriptions[0]['Columns']['uitName']['Value']=$tmpAR0[0];
			$pDescriptions[0]['Columns']['uitInterfaceNumcode']['Value']=$tmpAR0[2];
			$tmpINT=$this->CheckPower_Interface_Login($pDescriptions,$tmpAR0[1],$pPOST);
			if($tmpINT==0){
				$this->sysLastError='用户验证成功。';
				$this->TransRollback();
				return 0;
			}else {
				$this->sysLastError='用户验证失败。';
				$this->TransRollback();
				return 1;
			}
			
		}else {
			$this->sysLastError='用户验证失败。';
		}
		
		$this->TransCommit();
		return 1;
	}
	public function MakeApikey($pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$tmpAPIKEY='';
		//-- ------ # ------ --
		$tmpAPIKEY=$tmpCode->SamplePxd(
			$pDescriptions[0]['Columns']['uitID']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitName']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitPxd']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitNumCode']['Value'].$this->sysSPLIT1.
			$this->sysFileConfig['coreKeyword']
			);
		
		return $tmpAPIKEY;
	}
	public function Check_Interface($pAR){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpApp_Code=new netsCode();
		//-- ------ ### ------ --
		$tmpSQL=' SELECT A.uitID,A.uitName,A.uitPxd,A.uitNumCode,A.uitNickname
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND A.uitName LIKE \'{Nets.Name}\' AND A.uitNumCode LIKE \'{Nets.NumCode}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Name}',$pAR[0],$tmpSTR);
		$tmpSTR=str_replace('{Nets.NumCode}',$pAR[1],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)<=0){
			$this->sysLastError='您查询的用户不存在';
			return 1;
		}
		//-- ------ ### ------ --
		$tmpDbDescriptions=array();
		$tmpDbDescriptions[0]['Columns']['uitID']['Value']=$tmpData0[0]['uitID'];
		$tmpDbDescriptions[0]['Columns']['uitName']['Value']=$tmpData0[0]['uitName'];
		$tmpDbDescriptions[0]['Columns']['uitPxd']['Value']=$tmpData0[0]['uitPxd'];
		$tmpDbDescriptions[0]['Columns']['uitNumCode']['Value']=$tmpData0[0]['uitNumCode'];
		$tmpAPIKEY=$this->MakeApikey($tmpDbDescriptions);
		//-- ------ ### ------ --
		$tmpVALUE=$pAR[0].$this->sysSPLIT1.$pAR[1].$this->sysSPLIT1.$pAR[2].$this->sysSPLIT1.$pAR[3];
		$tmpVALUE_Check=$tmpData0[0]['uitName'].$this->sysSPLIT1.
			$tmpData0[0]['uitNumCode'].$this->sysSPLIT1.
			$pAR[2].$this->sysSPLIT1.
			$tmpApp_Code->SamplePxd(
				$tmpData0[0]['uitName'].$this->sysSPLIT1.
				$tmpData0[0]['uitNumCode'].$this->sysSPLIT1.
				$tmpData0[0]['uitPxd'].$this->sysSPLIT1.
				$pAR[2].$this->sysSPLIT1.
				$tmpAPIKEY
				);
		//-- ------ ### ------ --
		if ($tmpVALUE==$tmpVALUE_Check) {
		}else {
			$this->sysLastError='用户验证错误';
			return 1;
		}
		
		return 0;
	}
	public function MakeURL_Login($pUName,$pUPxd,$pPID,$pPPxd){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$tmpURL='';
		$tmpTimeCode=$tmpCode->TimeToInt(date($this->sysTimeFormat));
		//-- #MAKE --
		if($pPID==0){
			//-- #Easy --
			$pPPxd='';
		}else {
			//-- #Security --
		}
		$tmpURL=$pUName.$this->sysSPLIT1.$pPID.$this->sysSPLIT1.$tmpTimeCode.$this->sysSPLIT1.
			$tmpCode->SamplePxd($pUName.$this->sysSPLIT1.$pUPxd.$this->sysSPLIT1.$pPPxd.$this->sysSPLIT1.$tmpTimeCode);
		
		return $tmpURL;
	}
	public function GetUserinfo(&$pDescriptions,$pColumnName){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//-- #GET --
		$tmpSQL=' SELECT uitID,uitName,uitPxd,uitEmail
			FROM {Nets.TableHead}netsuserinfo
			WHERE 1=1 {Nets.Column} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		if ($pDescriptions[0]['Columns'][$pColumnName]['stcoctDbType']=='Int') {
			$tmpSTR=str_replace('{Nets.Column}',' AND '.$pColumnName.'='.$pDescriptions[0]['Columns'][$pColumnName]['Value'].' ',$tmpSTR);
		}else {
			$tmpSTR=str_replace('{Nets.Column}',' AND '.$pColumnName.' LIKE \''.$pDescriptions[0]['Columns'][$pColumnName]['Value'].'\' ',$tmpSTR);
		}
		$tmpData0=$this->Search($tmpSTR);
		if (count($tmpData0)==0) {
			$this->sysLastError='对不起，您查询的用户不存在。';
			return $this->sysErrorFuncID.'001';
		}
		//-- #SET --
		$pDescriptions[0]['Columns']['uitID']['Value']=$tmpData0[0]['uitID'];
		$pDescriptions[0]['Columns']['uitName']['Value']=$tmpData0[0]['uitName'];
		$pDescriptions[0]['Columns']['uitPxd']['Value']=$tmpData0[0]['uitPxd'];
		$pDescriptions[0]['Columns']['uitEmail']['Value']=$tmpData0[0]['uitEmail'];
		
		return 0;
	}
	public function GetUserPowerArray($pDescriptions,$pFunctionname,$pType,&$pArray){
		//-- ------ ### ------ --
		$tmpSTR=$pDescriptions[5]['Columns']['utctPower_Menu_Mana']['Value'];
		if ($pType=='Mana') {
			$tmpSTR=$pDescriptions[5]['Columns']['utctPower_Menu_Mana']['Value'];
		}else if ($pType=='Platform') {
			$tmpSTR=$pDescriptions[5]['Columns']['utctPower_Menu_Platform']['Value'];
		}else if ($pType=='QPlatform') {
			$tmpSTR=$pDescriptions[5]['Columns']['utctPower_Menu_QPlatform']['Value'];
		}else if ($pType=='User') {
			$tmpSTR=$pDescriptions[5]['Columns']['utctPower_Menu_User']['Value'];
		}
		//-- ------ ### ------ --
		$tmpAR0=explode($this->sysSPLIT2,$tmpSTR);
		foreach ($tmpAR0 as $Row0){
			$tmpAR1=explode($this->sysSPLIT1,$Row0);
			if (count($tmpAR1)>1) {
				$pArray=$tmpAR1;
			}
		}
		
		
		return 0;
	}
	/**
	 * Save userinfo to cookie
	 */
	public function GetUserinfoFromCookie(&$pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpHtml=new netsHtml();
		//-- ------ #Check userinfo entity ------ --
		if (!isset($pDescriptions)) {
			$this->sysLastError='取得用户信息失败，请与客服人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		if (!isset($pDescriptions[0])) {
			$this->sysLastError='取得用户信息失败，请与客服人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		if (!isset($pDescriptions[0]['Columns'])) {
			$this->sysLastError='取得用户信息失败，请与客服人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		if (!isset($pDescriptions[0]['Columns']['uitID'])) {
			$this->sysLastError='取得用户信息失败，请与客服人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		if ($pDescriptions[0]['Columns']['uitID']['Value']!=0) {
			$this->sysLastError='用户已正常登陆。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Check cookie by userinfo ------ --
		//-- #Read --
		$tmpAR0=$tmpHtml->AnalyerRequest($this->sysCookieHead.$this->sysFileConfig['userTempCookieEntityName'],'',3);
		if ($tmpAR0[0]=='') {
			$this->sysLastError='未记录用户信息。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		$tmpUserInfo=explode($this->sysSPLIT15,$tmpAR0[0]);
		array_pop($tmpUserInfo);
		if (count($tmpUserInfo)!=count($this->sUserinfoCookieStruct)) {
			$this->sysLastError='用户未登陆或用户信息格式不正确。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- #Check --
		if (count($tmpUserInfo)<=0) {
			$this->sysLastError='取得用户信息失败，请与客服人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		if ($tmpUserInfo[0]!=$this->sysFileConfig['userTempCookieConfirmNumcode']) {
			$this->sysLastError='取得用户信息失败，用户信息识别码错误，请与客服人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Set userinfo entity ------ --
		//-- #Set --
		$Coun0=0;
		foreach ($this->sUserinfoCookieStruct as $Row0){
			if ($Coun0>0) {
				$pDescriptions[$Row0[0]]['Columns'][$Row0[1]]['Value']=$tmpUserInfo[$Coun0];
			}
			$Coun0++;
		}

		return 0;
	}
	public function SaveUserinfoToCookie(&$pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpHtml=new netsHtml();
		//-- ------ #Check userinfo entity ------ --
		if (!isset($pDescriptions)) {
			$this->sysLastError='取得用户信息失败，请与客服人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		if (!isset($pDescriptions[0])) {
			$this->sysLastError='取得用户信息失败，请与客服人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		if (!isset($pDescriptions[0]['Columns'])) {
			$this->sysLastError='取得用户信息失败，请与客服人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		if (!isset($pDescriptions[0]['Columns']['uitID'])) {
			$this->sysLastError='取得用户信息失败，请与客服人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		if ($pDescriptions[0]['Columns']['uitID']['Value']!=0) {
			$this->sysLastError='用户已正常登陆。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Save userinfo entity ------ --
		//-- #Set --
		$tmpAR0=array();
		$Coun0=0;
		foreach ($this->sUserinfoCookieStruct as $Row0){
			if ($Coun0==0) {
				$tmpAR0[]=$this->sysFileConfig['userTempCookieConfirmNumcode'];
			}else {
				$tmpAR0[]=$pDescriptions[$Row0[0]]['Columns'][$Row0[1]]['Value'];
			}
			$Coun0++;
		}
		//-- #Save --
		$tmpSTR='';
		foreach ($tmpAR0 as $Row0){
			$tmpSTR.=$Row0.$this->sysSPLIT15;
		}
		$tmpINT=$this->writeCookie($this->sysNormalCookiePath,$this->sysCookieHead.$this->sysFileConfig['userTempCookieEntityName'],$tmpSTR);
		
		return 0;
	}
	public function ClearUserinfoCookie(){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpHtml=new netsHtml();
		//-- ------ #Clear ------ --
		$this->writeCookie($this->sysNormalCookiePath,$this->sysCookieHead.$this->sysFileConfig['userTempCookieEntityName'],'');
		
		return 0;
	}
	//-- ------ #Confirm ------ --
	/**
	 * Enter description here...
	 *
	 * @return unknown
	 */
	public function SetConfirm(&$pDescriptions,$pType){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//-- ------ #Get userinfo ------ --
		$tmpSQL=' SELECT A.uitID,A.uitName
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitChecked>1 AND A.uitID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpData_Userinfo=$this->Search($tmpSTR);
		if (count($tmpData_Userinfo)==0) {
			$this->sysLastError='登陆后才能进行用户认证';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Check ------ --
		if ($pType=='DConfirmEmail') {
			//DConfirmEmail
			if (strlen($pDescriptions[0]['Columns']['uitEmail']['Value'])<4) {
				$this->sysLastError='对不起，您输入的电邮格式不正确';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			
		}else if ($pType=='DConfirmMobile') {
			//DConfirmMobile
			if (strlen($pDescriptions[1]['Columns']['uictCo_Mobile']['Value'])<5) {
				$this->sysLastError='对不起，您输入的手机格式不正确';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			
		}else if ($pType=='DConfirmBank') {
			//DConfirmBank
			if (strlen($pDescriptions[1]['Columns']['uictPayBankCode']['Value'])<5){
				$this->sysLastError='对不起，您输入的银行帐号格式不正确';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (strlen($pDescriptions[1]['Columns']['uictPayBankName']['Value'])<2) {
				$this->sysLastError='对不起，您输入的开户行格式不正确';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (strlen($pDescriptions[1]['Columns']['uictPayBankUName']['Value'])<2) {
				$this->sysLastError='对不起，您输入的开户人格式不正确';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (strlen($pDescriptions[1]['Columns']['uictPayBankAddress']['Value'])<3) {
				$this->sysLastError='对不起，您输入的开户行所在地格式不正确';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			
		}else if ($pType=='DConfirmPay') {
			//DConfirmPay
			if (strlen($pDescriptions[1]['Columns']['uictPayType']['Value'])<=0) {
				$this->sysLastError='对不起，请先选择支付方式的类型';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (strlen($pDescriptions[1]['Columns']['uictPayCode']['Value'])<3) {
				$this->sysLastError='对不起，您输入的支付帐号格式不正确';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			
		}else if ($pType=='DConfirmPostcode') {
			//DConfirmPostcode
			if (strlen($pDescriptions[1]['Columns']['uictPostcode']['Value'])<9) {
				$this->sysLastError='对不起，您输入的身份证号格式不正确';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (strlen($pDescriptions[1]['Columns']['uictPostcodeSource']['Value'])<5) {
				$this->sysLastError='对不起，请先上传身份证截图或照片';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			
		}
		//-- ------ #Make NUM ------ --
		//-- #ADD --
		$tmpDbDescriptions=$this->sDbDescriptions_Other[0];
		//#Get numCode
		$tmpSTR='udtNumCode';
		$tmpDbDescriptions[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$tmpDbDescriptions[0]['Columns'][$tmpSTR]['Value']=$this->sysFileConfig['NumCodeHead_Normal'].$this->sysSPLIT11.date('YmdHis');
		$this->numCode($tmpDbDescriptions[0]);
		//#Set value
		if ($pType=='DConfirmEmail') {
			//DConfirmEmail
			$tmpDbDescriptions[0]['Columns']['udtType']['Value']=501;
			$tmpSTR=rand(0,99999);
			$tmpDbDescriptions[0]['Columns']['udtValue_STR']['Value']=$tmpSTR;
			
		}else if ($pType=='DConfirmMobile') {
			//DConfirmMobile
			$tmpDbDescriptions[0]['Columns']['udtType']['Value']=502;
			$tmpSTR=rand(0,99999);
			$tmpDbDescriptions[0]['Columns']['udtValue_STR']['Value']=$tmpSTR;
			
		}else if ($pType=='DConfirmBank') {
			//DConfirmBank
			$tmpDbDescriptions[0]['Columns']['udtType']['Value']=503;
			$tmpSTR=rand(0,99);
			$tmpDbDescriptions[0]['Columns']['udtValue_STR']['Value']=$tmpSTR;
			
		}else if ($pType=='DConfirmPay') {
			//DConfirmPay
			$tmpDbDescriptions[0]['Columns']['udtType']['Value']=504;
			$tmpSTR=rand(0,99);
			$tmpDbDescriptions[0]['Columns']['udtValue_STR']['Value']=$tmpSTR;
			
		}else if ($pType=='DConfirmPostcode') {
			//DConfirmPostcode
			$tmpDbDescriptions[0]['Columns']['udtType']['Value']=505;
			$tmpSTR=rand(0,99999);
			$tmpDbDescriptions[0]['Columns']['udtValue_STR']['Value']=$tmpSTR;
			
		}
		$tmpDbDescriptions[0]['Columns']['udtName']['Value']=$pType.$this->sysSPLIT11.$tmpDbDescriptions[0]['Columns']['udtNumCode']['Value'];
		$tmpDbDescriptions[0]['Columns']['udtState']['Value']=0;
		$tmpDbDescriptions[0]['Columns']['udtCreateBy']['Value']=$tmpData_Userinfo[0]['uitID'];
		$tmpDbDescriptions[0]['Columns']['udtCreateTime']['Value']=date($this->sysTimeFormat);
		//-- #Pass all daily --
		$tmpSQL=' UPDATE {Nets.TableHead}netsuserdaily AS A
			SET A.udtState=1
			WHERE 1=1 AND A.udtType={Nets.Type} AND A.udtState=0 AND A.udtCreateBy={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Type}',$tmpDbDescriptions[0]['Columns']['udtType']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.ID}',$tmpData_Userinfo[0]['uitID'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if ($tmpINT!=0) {
			$this->TransRollback();
			$this->sysLastError='更新验证码日志错误，请客服人员联系。';
			return $tmpINT;
		}
		//-- #Add --
		$tmpDbDescriptions[0]['TableDescription']['SearchColumn']='udtNumCode,udtID';
		$tmpDbDescriptions[1]['TableDescription']['SearchColumn']='udctIndexID';
		$tmpINT=$this->add($tmpDbDescriptions);
		if($tmpINT!=0){
			$this->TransRollback();
			$this->sysLastError='生成验证码日志错误，请客服人员联系。';
			return $tmpINT;
		}
		//-- ------ #Send message ------ --
		if ($pType=='DConfirmEmail') {
			//DConfirmEmail
			$tmpEmailApp=new netsEmail(array($this->sysFileConfig['EmailHost'],
				$this->sysFileConfig['EmailHostPost'],
				$this->sysFileConfig['EmailName'],
				$this->sysFileConfig['EmailPxd'],
				$this->sysCharset,));
			
			$tmpSTR=$this->sysFileConfig['EmailAccountConfirmTemplate'];
			$tmpSTR=str_replace('{Nets.Title}',$this->sysFileConfig['bussinessMetaTitle'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.Charset}',$this->sysCharset,$tmpSTR);
			$tmpSTR=str_replace('{Nets.Name}',$tmpData_Userinfo[0]['uitName'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.Page}',$this->sysSiteHome,$tmpSTR);
			$tmpSTR=str_replace('{Nets.Encryption}',$tmpData_Userinfo[0]['uitID'].$this->sysSPLIT1.$tmpDbDescriptions[0]['Columns']['udtValue_STR']['Value'],$tmpSTR);
			$tmpAR0=array(
				$pDescriptions[0]['Columns']['uitEmail']['Value'],
				$this->sysFileConfig['EmailName'],
				$this->sysFileConfig['bussinessMetaTitle'].' - 用户电子邮箱认证邮件',
				$tmpSTR,
				);
			$tmpINT=$tmpEmailApp->sendSmtp($tmpAR0);
			if ($tmpINT!=0) {
				$this->TransRollback();
				$this->sysLastError='发送用户电子邮箱认证邮件出错，请客服人员联系。';
				return $tmpINT;
			}
			
		}else if ($pType=='DConfirmMobile') {
			//DConfirmMobile
			$tmpMobileApp=new netsMobile(array(
				$this->sysFileConfig['MobileUName'],
				$this->sysFileConfig['MobilePxd'],
				$this->sysFileConfig['MobileSendURL'],
				$this->sysFileConfig['MobileReceiveURL'],
				$this->sysFileConfig['MobileCountURL'],));
			
			$tmpSTR=$this->sysFileConfig['MobileAccountConfirmTemplate'];
			$tmpSTR=str_replace('{Nets.Title}',$this->sysFileConfig['bussinessMetaTitle'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.Name}',$tmpData_Userinfo[0]['uitName'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.Encryption}',$tmpDbDescriptions[0]['Columns']['udtValue_STR']['Value'],$tmpSTR);
			
			$tmpINT=$tmpMobileApp->sendCSMS($pDescriptions[1]['Columns']['uictCo_Mobile']['Value'],$tmpSTR);
			if ($tmpINT!=0) {
				//$this->TransRollback();
				$this->sysLastError='发送用户手机认证短信出错，请客服人员联系。';
				//return $tmpINT;
			}
			
		}
		//-- ------ #Update info and checked state ------ --
		$tmpColumnName='';
		$tmpMessage='';
		if ($pType=='DConfirmEmail') {
			//DConfirmEmail
			$tmpColumnName='uictChecked_Email';
			$tmpMessage='您已成功提交了电子邮件认证信息，请到您的邮箱里查收认证邮件并完成电子邮件认证';
			
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfo AS A
				SET A.uitEmail=\'{Nets.uitEmail}\'
				WHERE 1=1 AND A.uitID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.uitEmail}',$pDescriptions[0]['Columns']['uitEmail']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.ID}',$tmpData_Userinfo[0]['uitID'],$tmpSTR);
			
		}else if ($pType=='DConfirmMobile') {
			//DConfirmMobile
			$tmpColumnName='uictChecked_Mobile';
			$tmpMessage='您已成功提交了手机认证信息，请查收手机短信并回到认证页面提交您所收到的认证码';
			
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfocont AS A
				SET A.uictCo_Mobile=\'{Nets.uictCo_Mobile}\'
				WHERE 1=1 AND A.uictIndexID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.uictCo_Mobile}',$pDescriptions[1]['Columns']['uictCo_Mobile']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.ID}',$tmpData_Userinfo[0]['uitID'],$tmpSTR);
			
		}else if ($pType=='DConfirmBank') {
			//DConfirmBank
			$tmpColumnName='uictChecked_Bank';
			$tmpMessage='您已成功提交了银行帐号认证信息，请到您的银行账户里查收认证款项（款项为0.01元-0.99元）';
			
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfocont AS A
				SET A.uictPayBankCode=\'{Nets.uictPayBankCode}\',A.uictPayBankName=\'{Nets.uictPayBankName}\',
				A.uictPayBankUName=\'{Nets.uictPayBankUName}\',A.uictPayBankAddress=\'{Nets.uictPayBankAddress}\'
				WHERE 1=1 AND A.uictIndexID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.uictPayBankCode}',$pDescriptions[1]['Columns']['uictPayBankCode']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.uictPayBankName}',$pDescriptions[1]['Columns']['uictPayBankName']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.uictPayBankUName}',$pDescriptions[1]['Columns']['uictPayBankUName']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.uictPayBankAddress}',$pDescriptions[1]['Columns']['uictPayBankAddress']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.ID}',$tmpData_Userinfo[0]['uitID'],$tmpSTR);
			
		}else if ($pType=='DConfirmPay') {
			//DConfirmPay
			$tmpColumnName='uictChecked_Pay';
			$tmpMessage='您已成功提交了网上支付帐号认证信息，请到您的网上支付账户里查收认证款项（款项为0.01元-0.99元）';
			
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfocont AS A
				SET A.uictPayType=\'{Nets.uictPayType}\',A.uictPayCode=\'{Nets.uictPayCode}\'
				WHERE 1=1 AND A.uictIndexID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.uictPayType}',$pDescriptions[1]['Columns']['uictPayType']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.uictPayCode}',$pDescriptions[1]['Columns']['uictPayCode']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.ID}',$tmpData_Userinfo[0]['uitID'],$tmpSTR);
			
		}else if ($pType=='DConfirmPostcode') {
			//DConfirmPostcode
			$tmpColumnName='uictChecked_Postcode';
			$tmpMessage='您已成功提交了身份证号认证信息，请等稍工作人员审核';
			
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfocont AS A
				SET A.uictPostcode=\'{Nets.uictPostcode}\',A.uictPostcodeSource=\'{Nets.uictPostcodeSource}\'
				WHERE 1=1 AND A.uictIndexID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.uictPostcode}',$pDescriptions[1]['Columns']['uictPostcode']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.uictPostcodeSource}',$pDescriptions[1]['Columns']['uictPostcodeSource']['Value'],$tmpSTR);
			$tmpSTR=str_replace('{Nets.ID}',$tmpData_Userinfo[0]['uitID'],$tmpSTR);
			
		}
		$tmpINT=$this->Execute($tmpSTR);
		if ($tmpINT!=0) {
			$this->TransRollback();
			$this->sysLastError='更新用户认证信息错误，请客服人员联系。';
			return $tmpINT;
		}
		
		$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfocont AS A
			SET A.{Nets.ColumnName}=1
			WHERE 1=1 AND A.uictIndexID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ColumnName}',$tmpColumnName,$tmpSTR);
		$tmpSTR=str_replace('{Nets.ID}',$tmpData_Userinfo[0]['uitID'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if ($tmpINT!=0) {
			$this->TransRollback();
			$this->sysLastError='更新用户认证状态错误，请客服人员联系。';
			return $tmpINT;
		}
		
		$this->sysLastMessage=$tmpMessage;
		$this->TransCommit();
		return 0;
	}
	public function SetConfirm_Callback(&$pDescriptions,$pType){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//-- ------ #Get userinfo ------ --
		$tmpSQL=' SELECT A.uitID,A.uitName
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitChecked>1 AND A.uitID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpData_Userinfo=$this->Search($tmpSTR);
		if (count($tmpData_Userinfo)==0) {
			$this->sysLastError='登陆后才能进行用户认证';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Check NUM ------ --
		$tmpTypeCode=0;
		if ($pType=='DConfirmEmail_Callback') {
			//DConfirmEmail
			$tmpTypeCode=501;
			
		}else if ($pType=='DConfirmMobile_Callback') {
			//DConfirmMobile
			$tmpTypeCode=502;
			
		}else if ($pType=='DConfirmBank_Callback') {
			//DConfirmBank
			$tmpTypeCode=503;
			
		}else if ($pType=='DConfirmPay_Callback') {
			//DConfirmPay
			$tmpTypeCode=504;
			
		}else if ($pType=='DConfirmPostcode_Callback') {
			//DConfirmPostcode
			$tmpTypeCode=505;
			
		}
		//-- #Search --
		$tmpSQL=' SELECT A.udtID
			FROM {Nets.TableHead}netsuserdaily AS A
			WHERE 1=1 AND A.udtType={Nets.Type} AND A.udtState=0 AND A.udtCreateBy={Nets.CreateBy} AND A.udtValue_STR LIKE \'{Nets.Value}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Type}',$tmpTypeCode,$tmpSTR);
		$tmpSTR=str_replace('{Nets.Value}',$pDescriptions[0]['Columns']['uitCheckNum']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.CreateBy}',$tmpData_Userinfo[0]['uitID'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if (count($tmpData0)!=1) {
			$this->TransRollback();
			$this->sysLastError='对不起，您提交的用户认证码不正确，请确认后再试';
			return $this->sysErrorFuncID.'001';
		}
		//-- #Execute --
		$tmpSQL=' UPDATE {Nets.TableHead}netsuserdaily AS A
			SET A.udtState=2
			WHERE 1=1 AND A.udtType={Nets.Type} AND A.udtState=0 AND A.udtCreateBy={Nets.CreateBy} AND A.udtValue_STR LIKE \'{Nets.Value}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Type}',$tmpTypeCode,$tmpSTR);
		$tmpSTR=str_replace('{Nets.Value}',$pDescriptions[0]['Columns']['uitCheckNum']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.CreateBy}',$tmpData_Userinfo[0]['uitID'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if ($tmpINT!=0) {
			$this->TransRollback();
			$this->sysLastError='更新认证码日志错误，请客服人员联系。';
			return $tmpINT;
		}
		//-- ------ #Update info and checked state ------ --
		$tmpColumnName='';
		$tmpMessage='';
		if ($pType=='DConfirmEmail_Callback') {
			//DConfirmEmail
			$tmpColumnName='uictChecked_Email';
			$tmpMessage='您已成功通过了电子邮件认证';
			
		}else if ($pType=='DConfirmMobile_Callback') {
			//DConfirmMobile
			$tmpColumnName='uictChecked_Mobile';
			$tmpMessage='您已成功通过了手机认证';
			
		}else if ($pType=='DConfirmBank_Callback') {
			//DConfirmBank
			$tmpColumnName='uictChecked_Bank';
			$tmpMessage='您已成功通过了银行帐号认证';
			
		}else if ($pType=='DConfirmPay_Callback') {
			//DConfirmPay
			$tmpColumnName='uictChecked_Pay';
			$tmpMessage='您已成功通过了网上支付帐号认证';
			
		}else if ($pType=='DConfirmPostcode_Callback') {
			//DConfirmPostcode
			$tmpColumnName='uictChecked_Postcode';
			$tmpMessage='您已成功通过了身份证号认证';
			
		}
		$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfocont AS A
			SET A.{Nets.ColumnName}=2
			WHERE 1=1 AND A.uictIndexID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ColumnName}',$tmpColumnName,$tmpSTR);
		$tmpSTR=str_replace('{Nets.ID}',$tmpData_Userinfo[0]['uitID'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if ($tmpINT!=0) {
			$this->TransRollback();
			$this->sysLastError='更新用户认证状态错误，请客服人员联系。';
			return $tmpINT;
		}
		
		$this->sysLastMessage=$tmpMessage;
		$this->TransCommit();
		return 0;
	}
	//-- ------ #FindPxd ------ --
	/**
	 * Find pxd
	 */
	public function FindPxd(&$pDescriptions){
		$tmpSTR='';
		$tmpCode=new netsCode();
		//-- ------ #Search uitName and uitEmail ------ --
		$tmpSQL=' SELECT
			A.uitID,A.uitName,A.uitEmail,A.uitTypeid,A.uitGroupid,A.uitUnitid,A.uitPxd,A.uitChecked,A.uitCode,A.uitMoney
			FROM '.$this->sysTableHead.'netsuserinfo AS A
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitChecked>1 AND A.uitEmail LIKE \'{Nets.Email}\' ';
		$tmpSTR=str_replace('{Nets.Email}',$pDescriptions[0]['Columns']['uitEmail']['Value'],$tmpSQL);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)==0){
			$this->sysLastError='您的输入的用户信息并不存在，请确认后再输入';
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Get Encryption string ------ --
		$pDescriptions[0]['Columns']['uitID']['Value']=$tmpData0[0]['uitID'];
		$pDescriptions[0]['Columns']['uitName']['Value']=$tmpData0[0]['uitName'];
		$pDescriptions[0]['Columns']['uitEmail']['Value']=$tmpData0[0]['uitEmail'];
		$tmpSTR=$tmpCode->SamplePxd($tmpData0[0]['uitID'].$this->sysSPLIT1.
			$tmpData0[0]['uitName'].$this->sysSPLIT1.
			$tmpData0[0]['uitEmail'].$this->sysSPLIT1.
			$tmpData0[0]['uitPxd'].$this->sysSPLIT1.
			$tmpData0[0]['uitChecked'].$this->sysSPLIT1.
			$tmpData0[0]['uitCode'].$this->sysSPLIT1.
			$tmpData0[0]['uitMoney'].$this->sysSPLIT1.
			$tmpData0[0]['uitTypeid'].$this->sysSPLIT1.
			$tmpData0[0]['uitGroupid'].$this->sysSPLIT1.
			$tmpData0[0]['uitGroupid'].$this->sysSPLIT1.
			date('YmdHis')).$this->sysSPLIT1.$tmpData0[0]['uitID'];
		$pDescriptions[0]['Columns']['uitPxd']['Value']=$tmpSTR;
		//-- ------ #Write daily ------ --
		$tmpDescription=array($this->sDbDescriptions_Other[0][0],
			$this->sDbDescriptions_Other[0][1],);
		//#Get numCode
		$tmpSTR='udtNumCode';
		$tmpDescription[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$tmpDescription[0]['Columns'][$tmpSTR]['Value']='N_'.date('YmdHis');
		$this->numCode($tmpDescription[0]);
		
		$tmpSTR='用户'.$pDescriptions[0]['Columns']['uitName']['Value'].'找回密码，电邮为'.$pDescriptions[0]['Columns']['uitEmail']['Value'];
		$tmpDescription[0]['Columns']['udtName']['Value']=$tmpSTR;
		$tmpDescription[0]['Columns']['udtType']['Value']=2;
		$tmpDescription[0]['Columns']['udtState']['Value']=0;
		$tmpDescription[0]['Columns']['udtCreateBy']['Value']=$pDescriptions[0]['Columns']['uitID']['Value'];
		$tmpDescription[0]['Columns']['udtCreateTime']['Value']=date($this->sysTimeFormat);
		$tmpDescription[0]['Columns']['udtValue_STR']['Value']=$pDescriptions[0]['Columns']['uitPxd']['Value'];
		$tmpDescription[1]['Columns']['udctIntroduct']['Value']=$tmpSTR;

		$tmpDescription[0]['TableDescription']['SearchColumn']='udtNumCode,udtID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='udctIndexID';
		$tmpINT=$this->add($tmpDescription);
		if($tmpINT!=0){
			$this->sysLastError='找回密码时失败:生成日志错误，请稍后再试或与管理员联系。';
			return $this->sysErrorFuncID.'001';
		}
		
		return 0;
	}
	public function FindPxd_callback(&$pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		//-- ------ #Check ------ --
		$tmpSQL=' SELECT
			A.uitID,A.uitName,
			B.udtType,B.udtState,B.udtCreateTime
			((FROM {Nets.TableHead}netsuserinfo AS A
			INNER JOIN {Nets.TableHead}netsuserdaily AS B ON B.udtCreateBy=A.uitID)
			INNER JOIN {Nets.TableHead}netsuserdailycont AS C ON C.udctIndexID=B.udtID)
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitChecked>1
			AND A.uitID={Nets.ID} AND B.udtValue_STR LIKE \'{Nets.Encryption}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Encryption}',$pDescriptions[0]['Columns']['uitPxd']['Value'].$this->sysSPLIT1.$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)==0){
			$this->sysLastError='对不起，您所要找回密码的用户并不存在，或链接已过期。请重新找回密码或与客服人员联系。';
			return $this->sysErrorFuncID.'001';
		}
		if($tmpData0[0]['udtType']!=2){
			$this->sysLastError='对不起，链接已过期。请重新找回密码或与客服人员联系。';
			return $this->sysErrorFuncID.'002';
		}
		if($tmpData0[0]['udtState']!=0){
			$this->sysLastError='对不起，链接已过期。请重新找回密码或与客服人员联系。';
			return $this->sysErrorFuncID.'003';
		}
		$pDescriptions[0]['Columns']['uitID']['Value']=$tmpData0[0]['uitID'];
		$pDescriptions[0]['Columns']['uitName']['Value']=$tmpData0[0]['uitName'];
		return 0;
	}
	public function ModifyPxd($pDescriptions,$pNewPxd){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$this->TransStart();
		//-- ------ Confirm old PXD ------ --
		$tmpSQL=' SELECT
			A.uitID
			FROM '.$this->sysTableHead.'netsuserinfo AS A
			WHERE A.uitName=\'{Nets.Name}\' AND A.uitPxd=\'{Nets.Pxd}\' ';
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSQL);
		$tmpSTR=str_replace('{Nets.Pxd}',$tmpCode->SamplePxd($pDescriptions[0]['Columns']['uitPxd']['Value']),$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)==0){
			$this->sysLastError='您输入的密码不正确';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}else {
			$pDescriptions[0]['Columns']['uitID']['Value']=$tmpData0[0]['uitID'];
		}
		//-- ------ Update PXD ------ --
		$tmpSQL=' UPDATE '.$this->sysTableHead.'netsuserinfo SET uitPxd=\'{Nets.Pxd}\' WHERE uitID={Nets.Id}; ';
		$tmpSTR=str_replace('{Nets.Pxd}',$tmpCode->SamplePxd($pNewPxd),$tmpSQL);
		$tmpSTR=str_replace('{Nets.Id}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if($tmpINT!=0){
			$this->sysLastError='修改密码时出错，请与管理员联系';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		
		$this->TransCommit();
		return 0;
	}
	public function UpdatePxd($pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$this->TransStart();
		//-- ------ Confirm old PXD ------ --
		$tmpSQL=' SELECT
			A.uitID
			FROM '.$this->sysTableHead.'netsuserinfo AS A
			WHERE 1=1 AND A.uitID={Nets.ID} AND A.uitName=\'{Nets.Name}\' ';
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSQL);		
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)==0){
			$this->sysLastError='您要重新设置密码的用户不存在';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}else {
			$pDescriptions[0]['Columns']['uitID']['Value']=$tmpData0[0]['uitID'];
		}
		//-- ------ Update PXD ------ --
		$tmpSQL=' UPDATE '.$this->sysTableHead.'netsuserinfo SET uitPxd=\'{Nets.Pxd}\' WHERE uitID={Nets.Id}; ';
		$tmpSTR=str_replace('{Nets.Pxd}',$tmpCode->SamplePxd($pDescriptions[0]['Columns']['uitPxd']['Value']),$tmpSQL);
		$tmpSTR=str_replace('{Nets.Id}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if($tmpINT!=0){
			$this->sysLastError='修改密码时出错，请与管理员联系';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		
		$this->TransCommit();
		return 0;
	}
	public function viewsRecord($pUID,$pTablename,$pID){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpHtml=new netsHtml();
		
		$tmpCookiename=$this->sysCookieHead.'_UserViews_'.$pTablename.'_'.$pUID;
		$tmpAR0=$tmpHtml->AnalyerRequest($tmpCookiename,'',2);
		$tmpAR0[0].=$pID.$this->sysSPLIT2;
		$tmpAR0=explode($this->sysSPLIT2,$tmpAR0[0]);
		return $tmpAR0;
	}
	public function OffUser($pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$this->TransStart();
		//-- ------ # ------ --
		//#Check uitName
		$tmpSQL=' SELECT A.uitID
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitName LIKE \'{Nets.Name}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)!=1){
			$this->sysLastError='注销用户错误:用户不存在';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//#Check uitPxd
		$pDescriptions[0]['Columns']['uitPxd']['Value']=$tmpCode->SamplePxd($pDescriptions[0]['Columns']['uitPxd']['Value']);
		$tmpSQL=' SELECT A.uitID,A.uitNumCode
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND uitRecycle=0 AND A.uitName LIKE \'{Nets.Name}\' AND A.uitPxd LIKE \'{Nets.Pxd}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Pxd}',$pDescriptions[0]['Columns']['uitPxd']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)!=1){
			$this->sysLastError='注销用户错误:密码错误';
			$this->TransRollback();
			return $this->sysErrorFuncID.'002';
		}
		$pDescriptions[0]['Columns']['uitID']['Value']=$tmpData0[0]['uitID'];
		//-- ------ #Delete ------ --
		//User
		$tmpSQL=' DELETE FROM {Nets.TableHead}netsuserinfo WHERE 1=1 AND uitID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if($tmpINT!=0){
			$this->sysLastError='注销用户错误:删除用户信息时出错，请稍后再试或与管理员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		$tmpSQL=' DELETE FROM {Nets.TableHead}netsuserinfocont WHERE 1=1 AND uictIndexID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if($tmpINT!=0){
			$this->sysLastError='注销用户错误:删除用户信息时出错，请稍后再试或与管理员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		
		//-- ------ #Write daily ------ --
		$tmpDescription=array($this->sDbDescriptions_Other[0][0],
			$this->sDbDescriptions_Other[0][1],);
		//#Get numCode
		$tmpSTR='udtNumCode';
		$tmpDescription[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$tmpDescription[0]['Columns'][$tmpSTR]['Value']='N_'.date('YmdHis');
		$this->numCode($tmpDescription[0]);

		$tmpSTR=$tmpDescription[1]['Columns']['udctIntroduct']['Value'];
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Name}',$pDescriptions[0]['Columns']['uitName']['Value'],$tmpSTR);
		$tmpAR0=explode($this->sysSPLIT4,$tmpSTR);
		$tmpDescription[0]['Columns']['udtName']['Value']=$tmpAR0[0];
		$tmpDescription[1]['Columns']['udctIntroduct']['Value']=$tmpSTR;
		$tmpDescription[0]['Columns']['udtCreateTime']['Value']=date($this->sysTimeFormat);

		$tmpDescription[0]['TableDescription']['SearchColumn']='udtNumCode,udtID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='udctIndexID';
		$tmpINT=$this->add($tmpDescription);
		//-- ------ #Logout ------ --
		$this->writeCookie($this->sysNormalCookiePath,$this->sysCookieHead.$this->sysManaCookieName,'');
		
		$this->TransCommit();
		return 0;
	}
	/**
	 * Confirm
	 */
	public function regConfirmMakeMail(&$pDescriptions,$pType){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$this->TransStart();
		//-- ------ #Make STRING ------ --
		$tmpSTR=$tmpCode->SamplePxd(
			$pDescriptions[0]['Columns']['uitID']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitName']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitPxd']['Value'].$this->sysSPLIT1.
			$pDescriptions[0]['Columns']['uitEmail']['Value'].$this->sysSPLIT1.
			date($this->sysTimeFormat).$this->sysSPLIT1.
			$pType);
		$pDescriptions[0]['Columns']['uitPxd']['Value']=$tmpSTR.$this->sysSPLIT1.$pDescriptions[0]['Columns']['uitID']['Value'].$this->sysSPLIT1.$pType;
		//-- ------ #Write daily ------ --
		$tmpDescription=array($this->sDbDescriptions_Other[0][0],
			$this->sDbDescriptions_Other[0][1],);
		//#Get numCode
		$tmpSTR='udtNumCode';
		$tmpDescription[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$tmpDescription[0]['Columns'][$tmpSTR]['Value']='N_'.date('YmdHis');
		$this->numCode($tmpDescription[0]);
		
		$tmpSTR='用户'.$pDescriptions[0]['Columns']['uitName']['Value'].'验证邮件，电邮为'.$pDescriptions[0]['Columns']['uitEmail']['Value'];
		$tmpDescription[0]['Columns']['udtName']['Value']=$tmpSTR;
		$tmpDescription[0]['Columns']['udtType']['Value']=4;
		$tmpDescription[0]['Columns']['udtState']['Value']=0;
		$tmpDescription[0]['Columns']['udtCreateBy']['Value']=$pDescriptions[0]['Columns']['uitID']['Value'];
		$tmpDescription[0]['Columns']['udtCreateTime']['Value']=date($this->sysTimeFormat);
		$tmpDescription[0]['Columns']['udtValue_STR']['Value']=$pDescriptions[0]['Columns']['uitPxd']['Value'];
		$tmpDescription[1]['Columns']['udctIntroduct']['Value']=$tmpSTR;

		$tmpDescription[0]['TableDescription']['SearchColumn']='udtNumCode,udtID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='udctIndexID';
		$tmpINT=$this->add($tmpDescription);
		if($tmpINT!=0){
			$this->sysLastError='发送验证邮件时失败:生成日志错误，请稍后再试或与管理员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		
		$this->TransCommit();
		return 0;
	}
	public function regConfirmEmail_callback(&$pDescriptions,$pType){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$this->TransStart();
		//-- ------ #Check ------ --
		//-- #Check string --
		$tmpSQL=' SELECT A.uitID,A.uitName,A.uitPxd,A.uitEmail 
			FROM '.$this->sysTableHead.'netsuserinfo AS A
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSQL);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)==0){
			$this->sysLastError='对不起，您的加密认证符无效，您可以返回并重发注册邮件。';
			return $this->sysErrorFuncID.'001';
		}
		//-- #Check daily --
		$tmpSQL=' SELECT A.udtID,A.udtState
			FROM {Nets.TableHead}netsuserdaily AS A
			WHERE 1=1 AND A.udtType=4
			AND A.udtCreateBy={Nets.ID} AND A.udtValue_STR LIKE \'{Nets.Encryption}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Encryption}',$pDescriptions[0]['Columns']['uitPxd']['Value'].$this->sysSPLIT1.$pDescriptions[0]['Columns']['uitID']['Value'].$this->sysSPLIT1.$pType,$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)==0){
			$this->sysLastError='对不起，您的加密认证符无效，或链接已过期。请重发注册邮件或与客服人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		if($tmpData0[0]['udtState']!=0){
			$this->sysLastError='对不起，链接已过期。请重新找回密码或与客服人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- #Modify daily --
		$tmpSQL=' UPDATE {Nets.TableHead}netsuserdaily SET udtState=2 WHERE 1=1 AND udtType=4 AND udtCreateBy={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if($tmpINT!=0){
			$this->sysLastError='设置用户状态日志时出错，请与管理员联系';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- #Modify userinfo --
		if ($pType==1) {
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfo SET uitChecked=2 WHERE 1=1 AND uitID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			if($tmpINT!=0){
				$this->sysLastError='设置用户状态时出错，请与管理员联系';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfocont SET uictChecked_Email=2 WHERE 1=1 AND uictIndexID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			if($tmpINT!=0){
				$this->sysLastError='设置用户状态时出错，请与管理员联系';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			
		}else if ($pType==2) {
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfo SET uitState=0 WHERE 1=1 AND uitID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			if($tmpINT!=0){
				$this->sysLastError='设置用户状态时出错，请与管理员联系';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfocont SET uictChecked_Email=2 WHERE 1=1 AND uictIndexID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			if($tmpINT!=0){
				$this->sysLastError='设置用户状态时出错，请与管理员联系';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			
		}
		
		
		$this->TransCommit();
		return 0;
	}
	public function regConfirmMakeMobile(&$pDescriptions,$pType){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$this->TransStart();
		//-- ------ #Make STRING ------ --
		$pDescriptions[0]['Columns']['uitPxd']['Value']=rand(0,99999);
		//-- ------ #Write daily ------ --
		$tmpDescription=array(
			$this->sDbDescriptions_Other[0][0],
			$this->sDbDescriptions_Other[0][1],);
		//#Get numCode
		$tmpSTR='udtNumCode';
		$tmpDescription[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$tmpDescription[0]['Columns'][$tmpSTR]['Value']='N_'.date('YmdHis');
		$this->numCode($tmpDescription[0]);
		
		$tmpSTR='用户'.$pDescriptions[0]['Columns']['uitName']['Value'].'验证短信，手机号为'.$pDescriptions[0]['Columns']['uitMobile']['Value'];
		$tmpDescription[0]['Columns']['udtName']['Value']=$tmpSTR;
		$tmpDescription[0]['Columns']['udtType']['Value']=4;
		$tmpDescription[0]['Columns']['udtState']['Value']=0;
		$tmpDescription[0]['Columns']['udtCreateBy']['Value']=$pDescriptions[0]['Columns']['uitID']['Value'];
		$tmpDescription[0]['Columns']['udtCreateTime']['Value']=date($this->sysTimeFormat);
		$tmpDescription[0]['Columns']['udtValue_STR']['Value']=$pDescriptions[0]['Columns']['uitPxd']['Value'].$this->sysSPLIT1.$pType;
		$tmpDescription[1]['Columns']['udctIntroduct']['Value']=$tmpSTR;

		$tmpDescription[0]['TableDescription']['SearchColumn']='udtNumCode,udtID';
		$tmpDescription[1]['TableDescription']['SearchColumn']='udctIndexID';
		$tmpINT=$this->add($tmpDescription);
		if($tmpINT!=0){
			$this->sysLastError='发送验证邮件时失败:生成日志错误，请稍后再试或与管理员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		
		$this->TransCommit();
		return 0;
	}
	public function regConfirmMobile_callback(&$pDescriptions,$pType){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$this->TransStart();
		//-- ------ #Check ------ --
		//-- #Check string --
		$tmpSQL=' SELECT A.uitID,A.uitName,A.uitPxd,A.uitMobile 
			FROM '.$this->sysTableHead.'netsuserinfo AS A
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitMobile LIKE \'{Nets.ID}\' ';
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitMobile']['Value'],$tmpSQL);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)==0){
			$this->sysLastError='对不起，您要认证的手机号并不存在，请先注册。';
			return $this->sysErrorFuncID.'001';
		}
		$pDescriptions[0]['Columns']['uitID']['Value']=$tmpData0[0]['uitID'];
		//-- #Check daily --
		$tmpSQL=' SELECT A.udtID,A.udtState
			FROM {Nets.TableHead}netsuserdaily AS A
			WHERE 1=1 AND A.udtType=4 AND A.udtValue_STR LIKE \'{Nets.Encryption}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Encryption}',$pDescriptions[0]['Columns']['uitPxd']['Value'].$this->sysSPLIT1.$pType,$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if(count($tmpData0)==0){
			$this->sysLastError='对不起，您的加密认证符无效，或链接已过期。请重新发送手机认证短信或与客服人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		if($tmpData0[0]['udtState']!=0){
			$this->sysLastError='对不起，链接已过期。请重新手机认证短信或与客服人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- #Modify daily --
		$tmpSQL=' UPDATE {Nets.TableHead}netsuserdaily SET udtState=2 WHERE 1=1 AND udtType=4 AND udtCreateBy={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if($tmpINT!=0){
			$this->sysLastError='设置用户状态日志时出错，请与管理员联系';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- #Modify userinfo --
		if ($pType==1) {
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfo SET uitChecked=2 WHERE 1=1 AND uitID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			if($tmpINT!=0){
				$this->sysLastError='设置用户状态时出错，请与管理员联系';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfocont SET uictChecked_Mobile=2 WHERE 1=1 AND uictIndexID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			if($tmpINT!=0){
				$this->sysLastError='设置用户状态时出错，请与管理员联系';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			
		}else if ($pType==2) {
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfo SET uitState=0 WHERE 1=1 AND uitID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			if($tmpINT!=0){
				$this->sysLastError='设置用户状态时出错，请与管理员联系';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfocont SET uictChecked_Mobile=2 WHERE 1=1 AND uictIndexID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			if($tmpINT!=0){
				$this->sysLastError='设置用户状态时出错，请与管理员联系';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			
		}
		
		$this->TransCommit();
		return 0;
	}
	//-- ------ #Operation ------ --
	/**
	 * Initial
	 */
	public function initialUnit($pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$this->TransStart();
		//-- ------ # ------ --
		
		$this->TransCommit();
		return 0;
	}
	public function initialUser($pDescriptions){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$this->TransStart();
		//-- ------ #Userinfo group ------ --
		//-- #Search userinfo --
		$tmpSQL=' SELECT A.uitID,A.uitName,A.uitCode
			FROM {Nets.TableHead}netsuserinfo AS A 
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitChecked>1 AND A.uitID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpData_User=$this->Search($tmpSTR);
		if(count($tmpData_User)<=0){
			$this->sysLastError='对不起用户不存在，请与客服人员联系';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- #Search group --
		$tmpParid=3;
		$tmpSQL=' SELECT A.ugratID,A.ugratName,A.ugratCodeLimit_High,A.ugratCodeLimit_Low
			FROM {Nets.TableHead}netsusergrade AS A
			WHERE 1=1 AND A.ugratRecycle=0 AND A.ugratChecked>1 AND A.ugratParid={Nets.Parid} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Parid}',$tmpParid,$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		foreach ($tmpData0 as $Row0){
			if ($Row0['ugratCodeLimit_High']>=$tmpData_User[0]['uitCode'] &&
				$Row0['ugratCodeLimit_Low']<=$tmpData_User[0]['uitCode']){
				$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfo AS A
					SET A.uitGradeid={Nets.Gradeid}
					WHERE 1=1 AND A.uitID={Nets.ID} ';
				$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
				$tmpSTR=str_replace('{Nets.Gradeid}',$Row0['ugratID'],$tmpSTR);
				$tmpSTR=str_replace('{Nets.ID}',$tmpData_User[0]['uitID'],$tmpSTR);
				$tmpINT=$this->Execute($tmpSTR);
				if($tmpINT!=0){
					$this->sysLastError='更新用户等级是出错，请与客服人员联系';
					$this->TransRollback();
					return $this->sysErrorFuncID.'001';
				}
				
			}
		}
		
		$this->TransCommit();
		return 0;
	}
	public function CalculationCode($pDescriptions,$pSIGN){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$this->TransStart();
		//-- ------ #Get useroperation ------ --
		$tmpSQL=' SELECT A.uotID,A.uotName,
			B.uoctType,B.uoctSign,B.uoctTypeNum,B.uoctTimeLong,B.uoctRepeate,
			B.uoctCode_Code,B.uoctCode_Max,B.uoctCode_Min,B.uoctCode_Rare
			
			FROM ({Nets.TableHead}netsuseroperation AS A
			INNER JOIN {Nets.TableHead}netsuseroperationcont AS B ON B.uoctIndexID=A.uotID)
			WHERE 1=1 AND A.uotRecycle=0 AND A.uotChecked>1 AND B.uoctSign LIKE \'{Nets.SIGN}\'
			ORDER BY A.uotID DESC LIMIT 0,1 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.SIGN}',$pSIGN,$tmpSTR);
		$tmpData_Operation=$this->Search($tmpSTR);
		if (count($tmpData_Operation)<=0){
			$this->sysLastError='对不起，用户积分操作规则并不存在，请与客服人员联系';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #Calculation CODE ------ --
		//-- #Get userinfo --
		$tmpSQL=' SELECT A.uitID,A.uitName,A.uitCode
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitChecked>1 AND A.uitID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uortCreateBy']['Value'],$tmpSTR);
		$tmpData_User=$this->Search($tmpSTR);
		if (count($tmpData_User)<=0){
			$this->sysLastError='对不起，您要操作的用户并不存在，请与客服人员联系';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- #Calculation --
		$tmpCode=$tmpData_User[0]['uitCode']+$tmpData_Operation[0]['uoctCode_Code'];
		$tmpSQL=' UPDATE {Nets.TableHead}netsuserinfo AS A
			SET A.uitCode={Nets.Code}
			WHERE 1=1 AND A.uitID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Code}',$tmpCode,$tmpSTR);
		$tmpSTR=str_replace('{Nets.ID}',$pDescriptions[0]['Columns']['uortCreateBy']['Value'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if ($tmpINT!=0){
			$this->sysLastError='对不起，更新用户信息时出错，请与客服人员联系';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ------ #ADD ------ --
		$tmpSTR='uortNumCode';
		$pDescriptions[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$pDescriptions[0]['Columns'][$tmpSTR]['Value']='N_'.date('YmdHis');
		$tmpINT=$this->numCode($pDescriptions[0]);
		
		$pDescriptions[0]['Columns']['uortParid']['Value']=$tmpData_Operation[0]['uotID'];
		$pDescriptions[0]['Columns']['uortValue_DECIMAL']['Value']=$tmpData_Operation[0]['uoctCode_Code'];

		$pDescriptions[0]['TableDescription']['SearchColumn']='uortNumCode,uortID';
		$pDescriptions[1]['TableDescription']['SearchColumn']='uorctIndexID';
		$tmpINT=$this->add($pDescriptions);
		if($tmpINT!=0){
			$this->sysLastError='生成积分操作记录，请稍后再试';
			$this->TransRollback();
			return $tmpINT;
		}
		
		$this->TransCommit();
		return 0;
	}
	public function RecommendUser($pCode,&$pUser){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		//-- ------ ### ------ --
		//-- ### --
		$tmpSQL=' SELECT A.uitID,A.uitName,A.uitNumCode
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitChecked>1 
			AND A.uitNumCode LIKE \'{Nets.Numcode}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Numcode}',$pCode,$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if (count($tmpData0)==1) {
			$pUser=$tmpData0[0];
		}else {
			$pUser=array(
				'uitID'=>'',
				'uitName'=>'',
				'uitNumCode'=>'',
				);
		}
		//-- ### --
		$tmpSTR=$pUser['uitID'].$this->sysSPLIT5.$pUser['uitName'].$this->sysSPLIT5.$pUser['uitNumCode'];
		$this->writeCookie($this->sysNormalCookiePath,$this->sysCookieHead.$this->sysFileConfig['UserRecommendFlag'],$tmpSTR);
		
		
		$this->TransCommit();
		return 0;
	}
	//-- ------ #Power ------ --
	/**
	 * Check
	 */
	public function checkSKFCQWEJXVNSJL(){
		$tmpCode=new netsCode();
		//-- ------ #Temp ------ --
		$tmpSQL=' SELECT A.uitID FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpData0=$this->Search($tmpSTR);
		if (count($tmpData0)>$this->sKASDJI83VKJSDFKJSD) {
			$this->sysLastError='对不起，您使用的是网集软件免费版本，用户数不能超过'.$this->sKASDJI83VKJSDFKJSD.'位';
			return $this->sysErrorFuncID.'001';
		}
		return 0;
		//-- ------ #Read ------ --
		//-- #Read --
		$tmpCONTENT='';
		$tmpKSADJFCODE=$tmpCode->SamplePxd(
			$this->sysFileConfig['sysCorePowerNumcode'].
			$this->sysFileConfig['bussinessMetaTitle'].
			'http://'
			);
		$tmpURL=$this->sysFileConfig['sysCoreAPISITE'].$this->sysFileConfig['sysCorePowerURL'].
			'?Numcode='.$this->sysFileConfig['sysCorePowerNumcode'].
			'&Host='.$this->sSite.
			'&Code='.$tmpKSADJFCODE;
		$tmpCONTENT=$this->readURL($tmpURL);
		//-- ------ #Check format ------ --
		//-- #Has not net --
		$tmpSimpleXml=new netsSimpleXml();
		$tmpINT=$tmpSimpleXml->loadXml($tmpCONTENT);
		if ($tmpINT!=0) {
			$this->sysLastMessage='对不起，读取网集软件认证程序错误';
			return 0;
		}
		if (!isset($tmpSimpleXml->sXmlElement->netsRow[0])){
			$this->sysLastMessage='对不起，读取网集软件认证程序错误';
			return 0;
		}
		if (!isset($tmpSimpleXml->sXmlElement->netsRow[0]->Name)){
			$this->sysLastMessage='对不起，读取网集软件认证程序错误';
			return 0;
		}
		if (!isset($tmpSimpleXml->sXmlElement->netsRow[0]->Message)){
			$this->sysLastMessage='对不起，读取网集软件认证程序错误';
			return 0;
		}
		//-- #Has net --
		if ($tmpSimpleXml->sXmlElement->netsRow[0]->Name=='ERROR') {
		}else {
			//-- #SUCCESS --
			$this->sysLastMessage=$tmpSimpleXml->sXmlElement->netsRow[0]->Message;
			return 0;
		}
		//-- ------ #User count ------ --
		$tmpSQL=' SELECT A.uitID FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpData0=$this->Search($tmpSTR);
		if (count($tmpData0)>$this->sKASDJI83VKJSDFKJSD) {
			$this->sysLastError='对不起，您使用的是网集软件免费版本，用户数不能超过'.$this->sKASDJI83VKJSDFKJSD.'位';
			return $this->sysErrorFuncID.'001';
		}
		
		return 0;
	}
	public function checkF23HFSSHVS12(&$pData){
		$tmpCode=new netsCode();
		//-- ------ #Read ------ --
		$pData=array(
			'Time_End'=>date($this->sysTimeFormat),
			);
		return 1;
		//-- #Read --
		$tmpCONTENT='';
		$tmpKSADJFCODE=$tmpCode->SamplePxd(
			$this->sysFileConfig['sysCorePowerNumcode'].
			$this->sysFileConfig['bussinessMetaTitle'].
			'http://'
			);
		$tmpURL=$this->sysFileConfig['sysCoreAPISITE'].$this->sysFileConfig['sysCorePowerURL'].
			'?Numcode='.$this->sysFileConfig['sysCorePowerNumcode'].
			'&Host='.$this->sSite.
			'&Code='.$tmpKSADJFCODE;
		$tmpCONTENT=$this->readURL($tmpURL);
		//-- ------ #Check format ------ --
		//-- #Has not net --
		$tmpSimpleXml=new netsSimpleXml();
		$tmpINT=$tmpSimpleXml->loadXml($tmpCONTENT);
		if ($tmpINT!=0) {
			$this->sysLastMessage='对不起，读取网集软件认证程序错误';
			return 1;
		}
		if (!isset($tmpSimpleXml->sXmlElement->netsRow[0])){
			$this->sysLastMessage='对不起，读取网集软件认证程序错误';
			return 1;
		}
		if (!isset($tmpSimpleXml->sXmlElement->netsRow[0]->Name)){
			$this->sysLastMessage='对不起，读取网集软件认证程序错误';
			return 1;
		}
		if (!isset($tmpSimpleXml->sXmlElement->netsRow[0]->Message)){
			$this->sysLastMessage='对不起，读取网集软件认证程序错误';
			return 1;
		}
		//-- #Has net --
		if ($tmpSimpleXml->sXmlElement->netsRow[0]->Name=='ERROR') {
			return 1;
		}else {
			//-- #SUCCESS --
			$this->sysLastMessage=$tmpSimpleXml->sXmlElement->netsRow[0]->Message;
		}
		$pData=array(
			'Time_End'=>$tmpSimpleXml->sXmlElement->netsRow[0]->Value->dataRow->Time_End,
			);
		
		
		return 0;
	}
	
	
	
}
?>