<?php
/*
Autor: Lic. Carlos Alberto Vaca Coronado
Version: 3.2.0
*/

/*define("SERVER","localhost");
define("USER","root");
define("PASSWORD","");
define("BD","bell");*/

//define("SERVER","mysql38.ixwebhosting.com");
define("SERVER","LocalHost");
/*define("USER","set25cl_pixel1");
define("PASSWORD","P1x3l1t0");*/
define("USER","cvaca");
define("PASSWORD","12345");
define("BD","disxii");

$db_link = mysql_connect(SERVER, USER, PASSWORD) OR die("Error de conexión: " . mysql_error());
mysql_select_db(BD,$db_link);

getLic();

function getLic(){
$query="Select rfc_emisor, lr from configweb";
$rquery=mysql_query($query);
$total=mysql_num_rows($rquery);
if($total>0){
	while($temp=mysql_fetch_array($rquery)){
		$arreglo = str_split($temp["rfc_emisor"]);
		sort($arreglo);
		$cadena = print_r($arreglo,true);
		$m = md5($cadena);
		if($m != $temp["lr"]){
			session_unset();
			session_destroy();
			header( "Location: index.php?error=LICENCIA" );
			break;
		}
	}
}else{
			session_unset();
			session_destroy();
			header( "Location: index.php?error=LICENCIA" );
			break;
}
}
?>
