

<?php

  session_start();

  header("Content-Type: text/html; charset=UTF-8"); 

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

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

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

  $sessionactive = array_key_exists('login_appquadrata', $_SESSION) ? $_SESSION['login_appquadrata'] : '';

  //termina el llamado de las variables de session                  

  if ($sessionactive==1) {

    if ($_SESSION['login_appquadrata']==1) 

      {

        echo"<script language='javascript'>window.location='./home'</script>;";

        exit();

      }

  }else{

    $cookieactive = array_key_exists('onstar_appquadrata', $_SESSION) ? $_SESSION['onstar_appquadrata'] : '';

    if ($cookieactive==1) {   

      if ($_COOKIE['onstar_appquadrata']==1)

        {

          setcookie(onstar_centinela, 1, time() + (86400 * 365), "/");

          echo"<script language='javascript'>window.location='/login/secure/4c9184f37cff01bcdc32dc486ec36961.php?ee11cbb19052e40b07aac0ca060c23ee=$_COOKIE[tokenusu_appquadrata]&4c882dcb24bcb1bc225391a602feca7c=$_COOKIE[token_appquadrata]'</script>;";

        }

    }else{

      if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) 

        {

          $uri = 'http://';

        }else {

          $uri = 'http://';

        }

      $uri .= $_SERVER['HTTP_HOST'];

      

      //header('Location: '.$uri.'/appquadrata/login/');

      //header('Location: '.$uri.$_SERVER['REQUEST_URI'].'/login/');

      header('Location: ./login');

      exit;

    }

  }



?>

