![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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
|
|||
|
|||
|
I think i am only using variables: $user and $password, what special character do you mean??
__________________
Tine |
|||
| Google The UNIX and Linux Forums |