Code

Added check for incorrect referral url in gosa.conf.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 1 Dec 2006 05:42:36 +0000 (05:42 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 1 Dec 2006 05:42:36 +0000 (05:42 +0000)
Readded check for missing attributes in setup. (base)

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5276 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_ldap.inc
include/functions_setup.inc

index 9640ebbfde8dd366eabe01265b2a627e2b592ab6..ee6d9b00164cde81e1bec2fb4550fa1a53b1c2a9 100644 (file)
@@ -664,7 +664,13 @@ class LDAP{
     }
 
     $real_path= substr($target, 0, strlen($target) - strlen($this->basedn) -1 );
-    $l= array_reverse(ldap_explode_dn($real_path,0));
+    $tmp = ldap_explode_dn($real_path,0);
+    if(!$tmp){
+      print_red(sprintf(_("The referral url '%s' is missing the ldap base. It should look like this 'ldap://server:port/base'."),$this->fix($this->basedn)));
+      return;
+    }
+
+    $l= array_reverse($tmp);
     unset($l['count']);
     $cdn= $this->basedn;
     $tag= "";
index 64e9b414de6b8bd13ba6b53982eaab3e18b45fd5..43b2d32d80486b2c07c1c33efa29811d02db925e 100644 (file)
@@ -764,6 +764,14 @@ function show_setup_page3($withoutput = true)
 function show_setup_page4($withoutput = true)
 {
   $smarty= get_smarty();      
+  $checkvars = array("location", "admin", "password", "peopleou", "base",
+      "peopledn", "arr_crypts", "uidbase","errorlvl");
+
+  $fault     = false;              
+  $uri       = $_SESSION['ldapconf']['uri'];
+  $ldapconf  = $_SESSION['ldapconf'];
+  $arr_crypts= array();
+  $temp      = "";
 
   /* check POST data */
   if(isset($_POST['check'])) {
@@ -777,7 +785,8 @@ function show_setup_page4($withoutput = true)
         continue;
       }
 
-      if((isset($_POST[$key]))&&($_POST[$key]!="")) {
+      if((isset($_POST[$key]))&&(!empty($_POST[$key]))) {
+        echo $key." -> ".$_POST[$key]."<br>";
         $_SESSION['ldapconf'][$key] = $_POST[$key];
       } else {
         if($withoutput) {
@@ -803,14 +812,6 @@ function show_setup_page4($withoutput = true)
   }
   require_once("class_password-methods.inc");
 
-  $fault     = false;              
-  $uri       = $_SESSION['ldapconf']['uri'];
-  $ldapconf  = $_SESSION['ldapconf'];
-  $arr_crypts= array();
-  $temp      = "";
-  $checkvars = array("location", "admin", "password", "peopleou", "base",
-      "peopledn", "arr_crypts", "mail", "uidbase","errorlvl");
-
   if(!isset($_SESSION['ldapconf']['arr_cryptkeys'])) {
     require_once("class_password-methods.inc");
     $tmp= passwordMethod::get_available_methods_if_not_loaded();