<?php



    require_once('../../odbconexion/config.php');

	include('../../centinela.php');

	require_once('../../bussines/fix_characters.php');

	$Obj_fix_characters=new fix_characters();





	if (!empty($_POST))

	{

		$login=!empty($_REQUEST['ccb33ceac6079060553f1b265b065555'])?$_REQUEST['ccb33ceac6079060553f1b265b065555']:'';

		$login=$Obj_fix_characters->fix($login);

		$error=!empty($_REQUEST['error'])?$_REQUEST['error']:'';

		$error=$Obj_fix_characters->fix($error);

		$passuno=!empty($_REQUEST['passuno'])?$_REQUEST['passuno']:'';

		$passuno=$Obj_fix_characters->fix($passuno);

		$passdos=!empty($_REQUEST['passdos'])?$_REQUEST['passdos']:'';

		$passdos=$Obj_fix_characters->fix($passdos);

		

		if ($passuno==$passdos&& strlen($passuno)>5 && strlen($passdos)>5) {

				try {

				for ($c = 1; $c <= 3; $c++) {

			    $passuno=md5($passuno);

				}

				$Odbj_conexion_usuario = new odbconexion;

	            $conexion=$Odbj_conexion_usuario->openconection();

	            $consulta="UPDATE login_appquadrata SET Usu_password='$passuno' WHERE Usu_correo='$login' || Usu_telefono='$login'";

	            $conexion->query($consulta);

	            $rowaffected=$conexion->affected_rows;

	            $conexion->close();



				// $conexion->query($consulta);

		header('Location: /login/secure/4c9184f37cff01bcdc32dc486ec36961.php?ee11cbb19052e40b07aac0ca060c23ee='.$login.'&4c882dcb24bcb1bc225391a602feca7c='.$passuno);

				}

			    catch (Exception $e) {

	 			echo 'Excepcion capturada: ',  $e->getMessage(), "\n";

				}



			}

			else{

				$Odbj_conexion_usuario = new odbconexion;

	            $conexion=$Odbj_conexion_usuario->openconection();

	            $consulta="UPDATE login_appquadrata SET Usu_password='$passuno' WHERE Usu_correo='$login' || Usu_telefono='$login'";

	            $conexion->query($consulta);

	            $rowaffected=$conexion->affected_rows;

	            $conexion->close();			

				header('Location: /login/?login='.$login.'&error=ACTIVIDAD SOSPECHOSA, CUENTA SUSPENDIDA '.$login);

				}

	}

	else

	{

		accessDenied();

		header('Location: /login/?login='.$login);

	}



?>