From bbe481a7fa159db107c7005f8b024bf4657c0bd6 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Thu, 4 Dec 2014 14:34:24 +0100 Subject: Backend for checking uptime --- isup/ajax.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ isup/http.php | 31 +++++++++++++++++++++++++++++++ isup/index.php | 25 +++++++++++++++++++++++++ isup/ping.php | 26 ++++++++++++++++++++++++++ 4 files changed, 130 insertions(+) create mode 100644 isup/ajax.php create mode 100644 isup/http.php create mode 100644 isup/index.php create mode 100644 isup/ping.php diff --git a/isup/ajax.php b/isup/ajax.php new file mode 100644 index 0000000..3e21a20 --- /dev/null +++ b/isup/ajax.php @@ -0,0 +1,48 @@ +=200 && $httpcode<400 ) + return true; + else + return false; +} + +function sanitizeUrl($url){ + if ( ! preg_match("|^[a-zA-Z]+://|", $url) ) + $url = "http://" . $url; + if ( preg_match("|^[a-zA-Z]+://.+\.[a-zA-Z]+(?/.*)|", $url, $match) ) + $url = str_replace($match["query"], "", $url); + + return $url; +} diff --git a/isup/index.php b/isup/index.php new file mode 100644 index 0000000..9c856c8 --- /dev/null +++ b/isup/index.php @@ -0,0 +1,25 @@ + + + + + + + + + IsUP | iamfabulous.de + + + + + +
+
+
+ +
+
+
+ + diff --git a/isup/ping.php b/isup/ping.php new file mode 100644 index 0000000..4c1bea7 --- /dev/null +++ b/isup/ping.php @@ -0,0 +1,26 @@ + /dev/null 2>&1", $ret); + + if ( $ret != 0 ) + return false; + + return true; +} + +function sanitizeHost($host){ + + if ( preg_match("|^[a-zA-Z]+://|", $host, $match) ) + $host = str_replace($match[0], "", $host); + if ( preg_match("|(?/.*)|", $host, $match) ) + $host = str_replace($match["query"], "", $host); + + return escapeshellarg($host); +} -- cgit v1.2.3