From: hickert Date: Fri, 1 Dec 2006 05:42:36 +0000 (+0000) Subject: Added check for incorrect referral url in gosa.conf. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=58f91116432fbf5fe26991f2905f89d6f7e201cb;p=gosa.git Added check for incorrect referral url in gosa.conf. 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 --- diff --git a/include/class_ldap.inc b/include/class_ldap.inc index 9640ebbfd..ee6d9b001 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -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= ""; diff --git a/include/functions_setup.inc b/include/functions_setup.inc index 64e9b414d..43b2d32d8 100644 --- a/include/functions_setup.inc +++ b/include/functions_setup.inc @@ -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]."
"; $_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();