<?php
/*=======================================================================
 *
 * glob_defs.inc.php
 *
 * Autor: Carsten Annacker, Marc Vollmann
 *
 =======================================================================*/


$dbhost="172.16.0.123:3391";

$dblogin=(PHP_VERSION_ID != '50638' ? "phoenix" : "phoenix_new");
// $dblogin=(PHP_VERSION_ID != '50638' ? "service" : "service_new");
$dbpassword="AdAdgkS13";
// $dbpassword="srvc_79531";
$dbname="phoenix";

$dbhost2="172.16.0.123:3391";
$dblogin2=$dblogin;
$dbpassword2=$dbpassword;
$dbname2="phoenix";

$dbhost3="172.16.0.123:3391";
$dblogin3=$dblogin2;
$dbpassword3=$dbpassword2;
$dbname3=$dbname2;

$dbhostStatistic = "172.16.0.148:3391";

$dbhostJob2History = "172.16.0.123:3381";

function my_addslashes($a) {
  if (!(strpos($a, "'") === false
    && strpos($a, "\"") === false
    && strpos($a, "\\") === false)) {
    return addslashes($a);
  }
  return $a;
}

// http://php.net/manual/de/function.addslashes.php
function addslashes_array($a) {
  if (is_array($a)){
    foreach($a as $k => $v) {
      $b[$k] = addslashes_array($v);
    }
    return $b;
  } else {
    return my_addslashes($a);
  }
}

// Seit Firefox 48.0 wird offensichtlich in jedem Fall Unicode in den Get-Vars übertragen, auch wenn die Website selbst nicht Unicode ist.
// Daher müssen die Parameter mit potentiellen Umlauten erst decoded werden (siehe auch job_options.php).
foreach ($_GET as $k => $v) {
  $_GET[$k] = preg_replace("/([\xC2\xC3])([\x80-\xBF])/e", "chr(ord('\\1')<<6&0xC0|ord('\\2')&0x3F)", $v);
}

//print_r($_POST);
if (!get_magic_quotes_gpc()) {
  if (!empty($HTTP_POST_VARS)) {
    foreach ($HTTP_POST_VARS as $k => $v) {
      $HTTP_POST_VARS[$k] = addslashes_array($v);
    }
  } else {
    foreach ($_POST as $k => $v) {
      $_POST[$k] = addslashes_array($v);
    }
  }
  if (!empty($HTTP_GET_VARS)) {
    foreach ($HTTP_GET_VARS as $k => $v) {
      $HTTP_GET_VARS[$k] = addslashes_array($v);
    }
  } else {
    foreach ($_GET as $k => $v) {
      $_GET[$k] = addslashes_array($v);
    }
  }
}
//print_r($_POST);

$HTTP_POST_VARS = !empty($HTTP_POST_VARS) ? $HTTP_POST_VARS : $_POST;
$HTTP_GET_VARS = !empty($HTTP_GET_VARS) ? $HTTP_GET_VARS : $_GET;
$HTTP_COOKIE_VARS = !empty($HTTP_COOKIE_VARS) ? $HTTP_COOKIE_VARS : $_COOKIE;
$HTTP_SERVER_VARS = !empty($HTTP_SERVER_VARS) ? $HTTP_SERVER_VARS : $_SERVER;
$HTTP_ENV_VARS = !empty($HTTP_ENV_VARS) ? $HTTP_ENV_VARS : $_ENV;
$HTTP_POST_FILES = !empty($HTTP_POST_FILES) ? $HTTP_POST_FILES : $_FILES;

if (!isset($PHP_SELF))
  $PHP_SELF = $_SERVER["PHP_SELF"];

// ini_set('default_charset', 'iso-8895-15');
$htmlEntitiesCharset = "ISO-8859-15";
$htmlEntitiesFlags = ENT_COMPAT | ENT_HTML401;

?>
