Ldap setting

26 views
Skip to first unread message

Jung

unread,
Oct 13, 2010, 10:18:39 PM10/13/10
to Mobile Web OSP
Hi All,

May I first say that this is a fantastic open source I have ever
tried!
I just need to ask a question if someone can answer please.

Can you please help?

====

I am trying to set up a directory with ldap. I set up
ldap_services.php page with following info:

On config.gen.inc.php file:
$email_ending = "@foed.auckland.ac.nz";

on ldap_services.php file:
define("SERVER", "ldap");
define("DN","ou=Staff,DC=FOED,DC=AUCKLAND,DC=AC,DC=NZ");

But I am getting a following error:

Warning: ldap_get_entries() expects parameter 2 to be resource,
boolean given in /Applications/XAMPP/xamppfiles/htdocs/Mobile-Web/lib/
ldap_services.php on line 142

Warning: strpos() expects parameter 1 to be string, array given in /
Applications/XAMPP/xamppfiles/htdocs/Mobile-Web/lib/ldap_services.php
on line 68

Warning: ldap_get_entries() expects parameter 2 to be resource,
boolean given in /Applications/XAMPP/xamppfiles/htdocs/Mobile-Web/lib/
ldap_services.php on line 142


**

Line 142: $entries = ldap_get_entries($ds, $sr) or ldap_die("could
not get entries");
Line 68: if(strpos($words, '@') === False) {

Dave Olsen

unread,
Oct 13, 2010, 10:28:36 PM10/13/10
to mobile-...@googlegroups.com
I'm a little bleary-eyed as it's getting late on the east coast of the
states but I think the first thing to check is that hostname for your
server on line #12. That should be something like ldap.auckland.ac.nz.
I honestly don't know the full hostname for your LDAP server but it's
probably something like that.

I'm not sure why it would get past all the LDAP connect stuff but that
looks to me like a place to start at least.

--

Proud supporter of DC United

Jung

unread,
Oct 14, 2010, 6:58:21 PM10/14/10
to Mobile Web OSP
Thank you so much Dave,

yes, our ldap host name is ldap.auckland.ac.nz. it works fine with
other websites that we are using here.
When tried with original value from wvu ldap setting (just to see what
is happening), I don't get any errors but I cannot find any staff
member.
I think i am something important or I don't understand this properly.
I hope someone can help me to make this work please.

Many thanks!

Jung

unread,
Oct 21, 2010, 10:35:21 PM10/21/10
to Mobile Web OSP
I pretty much fixed the issue!

It searches fine only if I put a perfectly matched name.
Otherwise, I am getting following error:

Warning: ldap_read() [function.ldap-read]: Search: Operations error
in /Applications/XAMPP/xamppfiles/htdocs/Mobile-Web/lib/
ldap_services.php on line 185
Warning: ldap_get_entries() expects parameter 2 to be resource,
boolean given in /Applications/XAMPP/xamppfiles/htdocs/Mobile-Web/lib/
ldap_services.php on line 187


Line 185 -187 is as follows:
function lookup_username($id) {
if(strstr($id, '=')) {
//look up person by "dn" (distinct ldap name)
$ds = ldap_connect(SERVER);
$sr = ldap_read($ds, $id, "(objectclass=*)");

$entries = ldap_get_entries($ds, $sr);
return make_person($entries[0]);
} else {
$tmp = do_query(new QueryElement("uid", $id));
foreach($tmp as $key => $first) {
return make_person($first);
}
}
}



Any suggestion would be much appreciated!!

Thanks!
J
Reply all
Reply to author
Forward
0 new messages