<?php include 'includes/session.inc'; $Title = _('Report a bug to the KwaMoja team'); include 'includes/header.inc'; if (http_file_exists('http://kwamoja.com/buggenie/thebuggenie/kwamoja')) { echo '<script type="text/javascript">window.open(\'http://kwamoja.com/buggenie/thebuggenie/kwamoja\');</script>'; prnMsg(_('You will now be redirected to the KwaMoja bug genie. If you do not have an account then you can login as user - guest with password - guest. If you use the guest login you will not be notified of progress with your report'), 'info'); } else { prnMsg(_('You do not appear to have an internet connection. To use this function you require access to the internet'), 'warn'); } include 'includes/footer.inc';
function quote_oanda_currency($CurrCode) { if (http_file_exists('http://www.oanda.com/convert/fxdaily?value=1&redirected=1&exch=' . $CurrCode . '&format=CSV&dest=Get+Table&sel_list=' . $_SESSION['CompanyRecord']['currencydefault'])) { $page = file('http://www.oanda.com/convert/fxdaily?value=1&redirected=1&exch=' . $CurrCode . '&format=CSV&dest=Get+Table&sel_list=' . $_SESSION['CompanyRecord']['currencydefault']); $match = array(); preg_match('/(.+),(\\w{3}),([0-9.]+),([0-9.]+)/i', implode('', $page), $match); if (sizeof($match) > 0) { return $match[3]; } else { return false; } } }
function http_file_exists($url, $followRedirects = true) { $url_parsed = parse_url($url); extract($url_parsed); if (!@$scheme) { $url_parsed = parse_url('http://' . $url); } extract($url_parsed); if (!@$port) { $port = 80; } if (!@$path) { $path = '/'; } if (@$query) { $path .= '?' . $query; } $out = "HEAD {$path} HTTP/1.0\r\n"; $out .= "Host: {$host}\r\n"; $out .= "Connection: Close\r\n\r\n"; if (!($fp = @fsockopen($host, $port, $es, $en, 5))) { return false; } fwrite($fp, $out); while (!feof($fp)) { $s = fgets($fp, 128); if ($followRedirects && preg_match('/^Location:/i', $s) != false) { fclose($fp); return http_file_exists(trim(preg_replace("/Location:/i", "", $s))); } if (preg_match('/^HTTP(.*?)200/i', $s)) { fclose($fp); return true; } } fclose($fp); return false; }