summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4acc112)
raw | patch | inline | side by side (parent: 4acc112)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 8 Aug 2007 13:54:41 +0000 (13:54 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 8 Aug 2007 13:54:41 +0000 (13:54 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7004 594d385d-05f5-0310-b6e9-bd551577e9d8
include/functions.inc | patch | blob | history |
diff --git a/include/functions.inc b/include/functions.inc
index 1b1e03b011af27f823df7e953c50d5d3b17510da..50a9318b10ef939889aff16d829b16e5fc42685f 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
@@ -2566,5 +2566,23 @@ function get_languages($languages_in_own_language = FALSE,$strip_region_tag = FA
return($ret);
}
+
+/* Check if $ip1 and $ip2 represents a valid IP range
+ * returns TRUE in case of a valid range, FALSE in case of an error.
+ */
+function is_ip_range($ip1,$ip2)
+{
+ if(!is_ip($ip1) || !is_ip($ip2)){
+ return(FALSE);
+ }else{
+ $ar1 = split("\.",$ip1);
+ $var1 = $ar1[0] * (16777216) + $ar1[1] * (65536) + $ar1[2] * (256) + $ar1[3];
+
+ $ar2 = split("\.",$ip2);
+ $var2 = $ar2[0] * (16777216) + $ar2[1] * (65536) + $ar2[2] * (256) + $ar2[3];
+ return($var1 < $var2);
+ }
+}
+
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>