Code

Added netatalk share management
[gosa.git] / include / functions.inc
index 7c9427a6062cdde50d1e0f189917281ed622daeb..d93aa89095ea95dc1562d330af0273c7ea62fecb 100644 (file)
@@ -508,7 +508,7 @@ function get_list($filter, $subtreeACL, $base= "", $attributes= array(), $flags=
   if ($flags & GL_SUBSEARCH) {
     $ldap->search ($filter, $attributes);
   } else {
-    $ldap->ls ($filter);
+    $ldap->ls ($filter,$base,$attributes);
   }
 
   /* Check for size limit exceeded messages for GUI feedback */
@@ -836,7 +836,11 @@ function get_departments($ignore_dn= "")
     if ($dn == $ignore_dn){
       continue;
     }
-    $result[convert_department_dn($dn)]= $dn;
+
+    /* Only assign non-root departments */
+    if ($dn != $result['/']){
+      $result[convert_department_dn($dn)]= $dn;
+    }
   }
 
   return ($result);
@@ -861,7 +865,7 @@ function is_phone_nr($nr)
     return (TRUE);
   }
 
-  return preg_match ("/^[0-9 ()+*-]+$/", $nr);
+  return preg_match ("/^[\/0-9 ()+*-]+$/", $nr);
 }
 
 
@@ -1947,5 +1951,19 @@ function normalizeLdap($input)
 }
 
 
+/* Resturns the difference between to microtime() results in float  */
+function get_MicroTimeDiff($start , $stop)
+{
+  $a = split("\ ",$start);
+  $b = split("\ ",$stop);
+
+  $secs = $b[1] - $a[1];
+  $msecs= $b[0] - $a[0]; 
+
+  $ret = (float) ($secs+ $msecs);
+  return($ret);
+}
+
+
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>