<?php
	//-------------------------
	$StrId=V($_POST['TxtId']);
	$StrCmd=V($_POST['TxtAc']);
	$StrPa=V($_POST['TxtPa']);
	$StrP1=V($_POST['TxtP1']);
	$StrP2=V($_POST['TxtP2']);
	//FUNCIONES DE ACTUALIZACION+++++++
	if($StrCmd=="G"){
		$StrPas=gs("pass","usuarios","id_usuario=$USER_ID");
		if($StrPas!=$StrPa){
			$LStrMsg="El password actual ingresado es incorrecto";
			$LStrFoc="document.getElementById('TxtPa').focus();";						
			$StrPa="";
			$StrP1="";
			$StrP2="";
			$StrGT="S";
		}
		if(strlen($StrGT)==0){			
			$s="UPDATE usuarios SET pass='$StrP1' ".
			   "WHERE id_usuario=$USER_ID";
			ejt($s);
			//BIT
			$_BIT_MOD_ID="0";
			$_BIT_SQL_CAB="SQL";
			$_BIT_SQL_DET="";
			$_BIT_PHP="cambiarpas.php.php";
			$_BIT_ID=BIT_ADD("SISTEMA","CAMBIAR PASSWORD","GUARDAR",$_BIT_MOD_ID,$_BIT_SQL_CAB,$_BIT_SQL_DET,$_BIT_PHP);
			BIT_DET_ADD($_BIT_ID,$s);
			//BIT	
			if($LStrMM=="S")	$LStrMsg="El password ha sido cambiado satisfactoriamente";
			$LStrFoc="document.getElementById('TxtPa').focus();";
			$StrId="";
			$StrPa="";
			$StrP1="";
			$StrP2="";
			$StrGT="S";
		}
	}
	//
	if($StrGT=="S"){
		if(strlen($LStrMsg)>0){
			if(strlen($LStrFoc)==0){
				$LStrMsg="onload=\"alert('$LStrMsg');\"";
			}else{
				$LStrMsg="onload=\"alert('$LStrMsg');$LStrFoc;\"";
			}
		}else{
			if(strlen($LStrFoc)>0){
				$LStrMsg="onload=\"$LStrFoc;\"";
			}
		}
	}else{
		$LStrFoc="document.getElementById('TxtPa').focus();";
		$LStrMsg="onload=\"$LStrFoc;\"";
	}

?>