From 3e55208d7fa8bb18218a52fedbfd53403f06ab55 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 5 May 2006 03:44:23 +0000 Subject: [PATCH] updated setup schema check git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3201 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/functions_setup.inc | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/include/functions_setup.inc b/include/functions_setup.inc index fbee382bc..cabcbbdb1 100644 --- a/include/functions_setup.inc +++ b/include/functions_setup.inc @@ -32,28 +32,13 @@ function view_schema_check($table) function is_schema_readable($server, $admin, $password) { - $ds= ldap_connect ($server); - if (!$ds) { - return (false); - } - ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); - $r= ldap_bind ($ds, $admin, $password); - - /* Get base to look for schema */ - $sr = @ldap_read ($ds, NULL, "objectClass=*", array("subschemaSubentry")); - $attr= @ldap_get_entries($ds,$sr); - if (!isset($attr[0]['subschemasubentry'][0])){ - return (false); - } + $ldap = new LDAP($admin,$password,$server); + $tmp = $ldap->get_objectclasses(); - $nb= $attr[0]['subschemasubentry'][0]; - $objectclasses= array(); - $sr= ldap_read ($ds, $nb, "objectClass=*", array("objectclasses")); - $attrs= ldap_get_entries($ds,$sr); - if (!isset($attrs[0])){ - return (false); + if(count($tmp)){ + return(true); } - return(true); + return(false); } function schema_check($server, $admin, $password, $aff=0,$CalledByIndexPhP=false) -- 2.30.2