[Date Prev][Date Next] [Chronological] [Thread] [Top]

PHP 4.1.2 && err=50 (no write access to parent)



I've taken over the maintainence of phpQLAdmin, and are trying to
improve on it...

I authenticate as my own RDN which have full access to the db. From the
shell everything goes ok, but not from PHP (no write access to parent).

---- LDIF ----
dn: dc=test,dc=com
objectClass: top
objectClass: domain
dc: test
---- LDIF ----


----- shell command ----
[papadoc.pts/14]$ alias ldapadd
bash: alias: `ldapadd' not found
[papadoc.pts/14]$ ldapadd -h localhost -x -D 'UID=TURBO,OU=PEOPLE,DC=FREDRIKSSON,DC=COM' -W -f /tmp/test2.ldif 
Enter LDAP Password: 
adding new entry "dc=test,dc=com"
----- shell command ----


----- PHP DEBUG SNIPPET -----
----- DEBUG: pql_add_domain() ---
dn: dc=test,dc=com
objectClass: top
objectClass: domain
dc: test
LDAP-Error: Insufficient access
----- PHP DEBUG SNIPPET -----


---- PHP CODE SNIPPET ----
function pql_add_domain($ldap_linkid, $ldap_basedn, $domain){
    // adds a domain into ldap-tree (ou|dc-record)

    $entry["objectClass"][] = "top";
    $entry["objectClass"][] = PQL_LDAP_OBJECTCLASS_DOMAIN;
    $entry[PQL_LDAP_ATTR_DOMAIN] = $domain;
    $dn = PQL_LDAP_ATTR_DOMAIN . "=" . $domain . "," . $ldap_basedn;

    // --------------------------
    // DEBUG mode: Print the LDIF
    echo "<br>--- DEBUG: pql_add_domain() ---<br>";
    echo "dn: $dn<br>";
    foreach($entry as $key => $e) {
        if(eregi("objectclass", $key)) {
            // We have a objectClass
            if(is_array($entry[$key])) {
                // ... in an array. Go through each one, creating the LDAP entry
                foreach($entry[$key] as $oc) {
                    echo "$key: $oc<br>";
                }
            }
        } else {
            echo "$key: $entry[$key]<br>";
        }
    }
//  die("--- DEBUG ---");
    // --------------------------

    if(! @ldap_add($ldap_linkid, $dn, $entry)) {
        pql_errormsg($ldap_linkid);
die();  
        return false;
    }
---- PHP CODE SNIPPET ----


Anyone got an idea?