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

session_name('portal_absa');
session_start();

if(file_exists("config.ini")){
	$vlineas = file("config.ini");
	foreach ($vlineas as $sLinea) {
		if(substr($sLinea,0,5) == "RFCS="){
			$_SESSION["RFCS"]=trim(substr($sLinea,5));
		}elseif(substr($sLinea,0,11) == "RFCS_LIGAS="){
			$_SESSION["RFCS_LIGAS"]=trim(substr($sLinea,11));
		}elseif(substr($sLinea,0,11) == "URL_PORTAL="){
			$_SESSION["URL_PORTAL"]=trim(substr($sLinea,11));
		}
	}
}
$arrRFCS = explode(",",$_SESSION["RFCS"]);
$arrLigas = explode(",",$_SESSION["RFCS_LIGAS"]);


for($i=0; $i < count($arrRFCS); $i++){
	if($_SESSION['RFC_RECEPTOR_PORTAL']==$arrRFCS[$i])
		{$header=$arrLigas[$i]; break;}
}

session_unset();
session_destroy();
if(isset($_GET['accion']) && $_GET['accion'] == "ACTIVACION"){
	$usr=$_GET['usuarioActivar'];
	header( "Location: LoginActivar.php?razonSocial=".$_GET['razonSocial']."&usuario=$usr&accion=ACTIVACION&redir" );
}else{
header( "Location: $header" );
}
?> 