<?php
session_start();
$usuarioSession = $_SESSION['USUARIO'];
$grupo = $_SESSION['GRUPO'];
$contacto = $_SESSION['CONTACTO'];
$awa_session_id = $_SESSION['AWA_SESION_ID'];
include('includes/conex.php');
include('includes/eat.php');
include('includes/historial.php');
include('includes/functions.php');
if(!isset($usuarioSession) or $awa_session_id != $awa_id)
{
    eatCookies();
    header('Location:index.php');
}
if(isset($_COOKIE['usuario']) AND $_COOKIE['usuario'] != $staticUsu )
{
    eatCookies();
    header('Loction:index.php');
}
$control = 0;
$password = sha1(htmlspecialchars(mysqli_real_escape_string($con,$_POST['clave1'])));
$sqlPass = "UPDATE USUARIOS SET CLAVE = ?, CLAVE_TEMP = ? WHERE CONTACTO = ?";
$stmt = $con->prepare($sqlPass);
$stmt->bind_param('sii',$password,$control,$contacto);
$stmt->execute();
$stmt->get_result();
header('Location:dashboard.php');
?>