From 40843b9dd2060a081e6443d79868d950c157a13d Mon Sep 17 00:00:00 2001 From: tbrehm Date: Wed, 23 Mar 2011 09:48:40 +0000 Subject: [PATCH] Added new function get_ispconfig_url() to functions library. --- interface/lib/classes/functions.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/interface/lib/classes/functions.inc.php b/interface/lib/classes/functions.inc.php index 7934efb84..adc365c0e 100644 --- a/interface/lib/classes/functions.inc.php +++ b/interface/lib/classes/functions.inc.php @@ -96,6 +96,14 @@ class functions { return number_format((double)$number, $number_format_decimals, $number_format_dec_point, $number_format_thousands_sep); } + public function get_ispconfig_url() { + $url = (stristr($_SERVER['SERVER_PROTOCOL'],'HTTPS'))?'https':'http'; + $url .= '//'.$_SERVER['SERVER_NAME']; + if($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) { + $url .= ':'.$_SERVER['SERVER_PORT']; + } + return $url; + } } -- GitLab