summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c9759b2)
raw | patch | inline | side by side (parent: c9759b2)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 5 May 2006 03:44:23 +0000 (03:44 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 5 May 2006 03:44:23 +0000 (03:44 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3201 594d385d-05f5-0310-b6e9-bd551577e9d8
include/functions_setup.inc | patch | blob | history |
index fbee382bcffd46415d05e8492e03408881522e74..cabcbbdb1c9128883b402e4fe900c3d2757a03c0 100644 (file)
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)