The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Perl: Search for string on line then search and replace text Crypto Shell Programming and Scripting 4 01-04-2008 07:24 AM
Filter using awk arun_st UNIX for Dummies Questions & Answers 3 03-21-2007 05:20 AM
ldap for aix pascalbout AIX 0 07-27-2006 02:56 AM
problem with ldap search using c mridula High Level Programming 1 01-09-2006 07:33 PM
Ldap dipanrc Linux 2 12-28-2005 05:09 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-22-2003
Registered User
 

Join Date: Apr 2003
Location: Amsterdam - the Netherlands
Posts: 40
ldap search filter

Hi,
I am trying to do an ldapsearch with a filter that checks the uid and the userpassword:
$filter= "(&(uid=$user) (userpassword=$password)";
$objs = $ldap->search( base => $basedn, filter => "($filter)");

i based it on this example i found on CPAN:
$mesg = $ldap->search(
base => $base_dn,
scope => 'sub',
filter => '(|(objectclass=rfc822mailgroup)(sn=jones))'
);

My filter does not work and i cannot understand why.. if anyone has any ideas, please reply!

Tine
__________________
Tine
Forum Sponsor
  #2  
Old 09-22-2003
davidg's Avatar
Registered User
 

Join Date: Jul 2003
Location: Holland
Posts: 207
Wrong way of programming :

$filter= "(&(uid=$user) (userpassword=$password)";
$objs = $ldap->search( base => $basedn, filter => "($filter)");

You should not define an abject that way. Just do i the same as they do. You use special characters in a constant with variables inside. I'dd definitly choose for variables or constants. So use the filter global and fill itthe way they do. Of course you can use a variable to define the value of passwd.

Regs David
  #3  
Old 09-29-2003
Registered User
 

Join Date: Apr 2003
Location: Amsterdam - the Netherlands
Posts: 40
I think i am only using variables: $user and $password, what special character do you mean??
__________________
Tine
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:39 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0