[PHP] PHP and OpenLDAP

2002-01-03 Thread Quinn Perkins

I have installed OpenLDAP 2.x on an OS X Server 10.1.2 box. Everything 
seems to be fine. I have written a simple PHP front end to modify LDAP 
values. I can modify values in the core.schema without any problem, but 
if I try to modify anything in cosine.schema or inetorgperson.schema, I 
get an error (Warning: LDAP: modify operation could not be completed. in 
ldapeditor.b2.php on line 247)

This ONLY happens when I try and modify a value in a schema other than 
core.schema. The project I am working on will require use of cosine and 
inetorgperson schemas. This is a test page to make sure I can read/write 
values.

Any help would be tremendously appreciated!

My PHP code looks like this:

";

echo "document.forms[0].elements[0].value='". 
$info[0]["givenname"][0] ."';";
echo "document.forms[0].elements[2].value='". $info[0]["sn"][0] ."';";
echo "document.forms[0].elements[5].value='". $info[0]["mail"][0] ."';";
echo "document.forms[0].elements[22].value='". 
$info[0]["networklocurl"][0] ."';";
echo "document.forms[0].elements[23].value='". 
$info[0]["facsimileTelephoneNumber"][0] ."';";
echo "document.forms[0].elements[24].value='". 
$info[0]["aliasdata"][0] ."';";
echo "document.forms[0].elements[25].value='". 
$info[0]["homeTelephoneNumber"][0] ."';";
echo "document.forms[0].elements[26].value='". 
$info[0]["shell"][0] ."';";
echo "document.forms[0].elements[27].value='". 
$info[0]["otherMailbox"][0] ."';";

echo "";

ldap_close($ds);

} else {
echo "Unable to connect to LDAP server";
}
?>

My slapd.conf file looks like:

# $OpenLDAP: pkg/ldap/servers/slapd/slapd.conf,v 1.8.8.6 2001/04/20 
23:32:43 kurt Exp $
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
# include schema
include /usr/local/etc/openldap/schema/core.schema
include /usr/local/etc/openldap/schema/cosine.schema
include /usr/local/etc/openldap/schema/inetorgperson.schema

# Define global ACLs to disable default read access.
# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org

pidfile /usr/local/var/slapd.pid
argsfile /usr/local/var/slapd.args

# Load dynamic backend modules:
# modulepath /usr/local/libexec/openldap
# moduleload back_ldap.la
# moduleload back_ldbm.la
# moduleload back_passwd.la
# moduleload back_shell.la

###
# ldbm database definitions
###

database ldbm
suffix "dc=coloradobiz,dc=net"
suffix "o=portalware"
rootdn "cn=Manager,o=portalware"
#rootdn "cn=Manager,o=My Organization Name,c=US"
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw secret
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd/tools. Mode 700 recommended.
directory /usr/local/var/openldap-ldbm
# Indices to maintain
index objectClass eq


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP, LDAP and OS X

2002-01-15 Thread Quinn Perkins

The frustrating part is, I had this working on OS X 10.0.4. I am now 
running 10.1.2 Server.

I successfully build OpenLDAP and it is working fine.

I successfully built a version of PHP 4.0.6 for OS 10.1 with the 
instructions found at 
http://developer.apple.com/internet/macosx/php.html. It compiled without 
error using:

./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var 
--mandir=/usr/share/man --with-apxs --with-zlib --with-
ldap=/Users/quinn/Desktop/Services/ldap/ldap --disable-pear 
--enable-trans-sid

After moving the libphp4.so and editing the httpd.conf file, I started 
the web server, but got the following error:

dyld: /usr/sbin/httpd Undefined symbols:
_ldap_add_s
_ldap_bind_s
_ldap_compare_s
_ldap_count_entries
_ldap_count_values
_ldap_count_values_len
_ldap_delete_s
_ldap_dn2ufn
_ldap_err2string
_ldap_explode_dn
_ldap_first_attribute
_ldap_first_entry
_ldap_first_reference
_ldap_get_dn
_ldap_get_option
_ldap_get_values
_ldap_get_values_len
_ldap_initialize
_ldap_memfree
_ldap_modify_s
_ldap_msgfree
_ldap_next_attribute
_ldap_next_entry
_ldap_next_reference
_ldap_open
_ldap_parse_reference
_ldap_parse_result
_ldap_perror
_ldap_rename_s
_ldap_result
_ldap_search
_ldap_search_s
_ldap_set_option
_ldap_unbind_s
_ldap_value_free
_ldap_value_free_len
/usr/sbin/apachectl start: httpd could not be started

Now...my OpenLDAP works fine. My PHP with LDAP compiled without error. 
Anyone have any ideas as to what might be wrong?

- Quinn



[PHP] PHP, LDAP and SASL

2002-04-12 Thread Quinn Perkins

I have an OS X box that has been running PHP 4.1.2 and OpenLDAP 2.0.23 
without any problems. I can bind to the LDAP database from PHP and 
everyone is happy.

I wanted to build a new box with Cyrus-IMAP, Cyrus-SASL and OpenLDAP, 
moving my mail and authentication to it and leave the first box to just 
Apache and PHP. The second box appears to work fine.

Where I'm having problems is binding from my PHP/Apache box to the new 
OpenLDAP box. With identical schema and data, I get errors trying to 
bind to the SASL/LDAP box from my PHP/Apache box that I don't get trying 
to bind to the local LDAP database. I can authenticate locally using the 
LDAP tools with a password against the SASL system.

Does anyone have any idea if any of the following are true:

1) Do I have to build SASL and rebuild LDAP and then build a PHP against 
that LDAP to enable my PHP to bind to my Cyrus/SASL/LDAP box?
2) Is there something special on has to do to bind to a OpenLDAP/SASL 
rather than just OpenLDAP with PHP?

Quinn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Binding to LDAP/SASL w/PHP

2002-04-15 Thread Quinn Perkins

I have an OpenLDAP 2.0.23 installation running with SASL 1.5.27 to 
support a Cyrus IMAP/Postfix mail server. I would like to work with the 
LDAP directory with PHP 4.1.2.

I have another LDAP directory without SASL that I can bind to with PHP 
without any problem (all the same versions).

For some reason, it won't let me bind to the LDAP w/SASL giving me a 
"Warning: LDAP: Unable to bind to server: Inappropriate authentication" 
error and pointing to the line where I specify the password to bind with.

I've triple checked my settings and rebuilt the PHP with LDAP libraries 
compiled for SASL and can't find anything. I can use the standard set of 
ldap tools (ldapadd, ldapmodify, etc) locally on the LDAP/SASL machine 
with the same root dn and root password I am trying to use with PHP.

Is anyone using OpenLDAP, SASL and PHP? Since the root password is 
commented out and carried in SASL, and the root dn is in a different 
format ("uid=myadmin + realm=myrealm"), might there be a different 
syntax I should use my PHP commands?

Anyone have any ideas? Any help would be very much appreciated!

Quinn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php