summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 49db8a0)
raw | patch | inline | side by side (parent: 49db8a0)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 26 Jul 2005 09:21:25 +0000 (09:21 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 26 Jul 2005 09:21:25 +0000 (09:21 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1007 594d385d-05f5-0310-b6e9-bd551577e9d8
include/functions.inc | patch | blob | history |
diff --git a/include/functions.inc b/include/functions.inc
index db9cacaf2ac81a75c54745ef6326c8b3b5fd12b2..20d1d490f5ffba53293c45ad3455a68908724992 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
}
+function get_list2($subtreeACL, $filter, $subsearch= TRUE, $base="", $attrs= array(), $flag= FALSE)
+{
+ global $config;
+
+ /* Base the search on default base if not set */
+ $ldap= $config->get_ldap_link($flag);
+ if ($base == ""){
+ $ldap->cd ($config->current['BASE']);
+ } else {
+ $ldap->cd ($base);
+ }
+
+ /* Perform ONE or SUB scope searches? */
+ $ldap->ls ($filter);
+
+ /* Check for size limit exceeded messages for GUI feedback */
+ if (preg_match("/size limit/i", $ldap->error)){
+ $_SESSION['limit_exceeded']= TRUE;
+ } else {
+ $_SESSION['limit_exceeded']= FALSE;
+ }
+ $result= array();
+
+
+ /* Crawl through reslut entries and perform the migration to the
+ result array */
+ while($attrs = $ldap->fetch()) {
+ $dn= preg_replace("/[ ]*,[ ]*/", ",", $ldap->getDN());
+ foreach ($subtreeACL as $key => $value){
+ if (preg_match("/$key/", $dn)){
+ $attrs["dn"]= convert_department_dn($dn);
+ $result[]= $attrs;
+ break;
+ }
+ }
+ }
+
+
+ return ($result);
+
+}
+
function get_list($subtreeACL, $filter, $subsearch= TRUE, $base="", $attrs= array(), $flag= FALSE)
{
global $config;
return rtrim($dep, "/");
}
+function convert_department_dn2($dn)
+{
+ $dep= "";
+
+ /* Build a sub-directory style list of the tree level
+ specified in $dn */
+ $tmp = split (",", $dn);
+
+ $dep= preg_replace("%^.*/([^/]+)$%", "\\1", $tmp[0]);
+
+
+ /* Return and remove accidently trailing slashes */
+ $tmp = rtrim($dep, "/");
+ return $tmp;
+}
+
function get_ou($name)
{
}
$numpages= (($dcnt / $range));
- if(((int)($numpages))!=($numpages))
+
+ if ((int)$numpages <= 1 ){
+ return ("");
+ }
+
+ if(((int)($numpages))!=($numpages)){
$numpages = (int)$numpages + 1;
+ }
$ppage= (int)(($start / $range) + 0.5);