<?
session_name('portal_absa');
session_start();
if(!isset($_SESSION['usuario_p_prov_absa']) || trim($_SESSION['usuario_p_prov_absa']) == "" || trim(strtoupper($_SESSION["URL_PORTAL"]."admin.php")) != trim(strtoupper($_SERVER['HTTP_REFERER']))){
	?><script>window.location.href="<?=$_SESSION["URL_PORTAL"]."index.php"?>"</script><?
	exit;
}
require "../conexion/conectar.php";

$conexion = new CONDB();
$conexion->conectar();

$username = $_POST['usuario'];
$email = $_POST['email'];

if(trim($email) != ""){
	if(mysqli_query($conexion->CONEXION,"update usuariosweb set email='$email' where username='$username'")){
		echo "true";
	}else{
		echo "false";
	}
}

$conexion->desconectar();

?>