LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-28-2006, 10:22 AM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Question php: scope in ldap_search


Is it possible to set the search scope in ldap_search?

I want to ask something like:
ldap://DOMAIN\username@ldapserver/dc=name1,dc=name2?one

but anyway... how can I set that I'd like to go one, base or sub?

Last edited by eantoranz; 04-28-2006 at 10:26 AM.
 
Old 04-28-2006, 10:36 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
ldapsearch() does scope sub
ldaplist() does scope one
ldapread() does scope base
 
Old 04-28-2006, 11:04 AM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
OK.... where's what I found:
sub: ldap_search
one: ldap_list
base: ldap_read

I tried ldap_read to get a certain dn (the root node's dn).

This is the output:
Warning: ldap_read(): Search: Internal (implementation specific) error in blahblah.php on line 27.

Was that my mistake? I'm using ActiveDirectory as the LDAP server.. and I'm bound to it.

This is the code in question:
Code:
$search = ldap_read($conection, $dn, "");
$entry = ldap_get_entries($conection, $search);
The dn is the directory's root node. I've double checked.

Last edited by eantoranz; 04-28-2006 at 11:09 AM.
 
Old 04-28-2006, 11:06 AM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Thanks for writing, man. Any idea of the error I wrote about?

Last edited by eantoranz; 04-28-2006 at 11:07 AM.
 
Old 04-28-2006, 04:08 PM   #5
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
Originally Posted by eantoranz
Code:
$search = ldap_read($conection, $dn, "");
$entry = ldap_get_entries($conection, $search);
The ldap_read() doc says:
Quote:
Originally Posted by the doc
An empty filter is not allowed. If you want to retrieve absolutely all information for this entry, use a filter of "objectClass=*".
Not sure at all if this is the cause of your error, but I'd fix that first.
 
Old 05-02-2006, 10:02 AM   #6
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
It worked... thanks! :-)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how the scope of RHCE ? tofee Linux - Newbie 1 04-10-2006 06:44 AM
$_POST Data to ldap_search() ckoniecny Programming 2 03-08-2006 05:57 PM
scope of an object and global scope lucky6969b Programming 7 12-09-2005 09:09 PM
scope suchi_s Programming 1 10-30-2004 07:07 AM
question about scope in c++ PTBmilo Programming 7 02-10-2003 04:59 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration