I've got an LDAP method called 'getuser' which simply returns all the information for a particular userid. This part seems to work ok. I am having a really weird problem with trying to use the information I get from it, though: <dtml-call "REQUEST.set('userid', 'someone')"> <dtml-in getuser> <dtml-call "REQUEST.set('foo', departmentnumber)"> </dtml-in> <dtml-if "foo == 'RU168'"> match! <dtml-else> foo .<dtml-var foo>. <p><dtml-var REQUEST> </dtml-if> This prints: foo .RU168. So foo is RU168, but the conditional still fails for some reason. Now, if I do virtually the same thing with an SQL method, it works fine (prints "match!"). I can get the results, print them, and compare them. The weird behavior only happens with the data from an LDAP method. I've tried with the conditional inside the dtml-in. I've tried comparing departmentnumber instead of foo. Always the same result. Printing <dtml-var departmentnumber> gives me RU168. Can anyone shed some light on this or offer some debugging hints? Thanks -- <BLINK> ;for (74,1970500640,1634627444,1751478816,1348825708,543711587, 1801810465){for($x=1<<1^1;$x>=1>>1;$x--) {$q=hex ff,$r=oct($x=~s,\d,$&* 10,e,$x),$x/=1/.1,$q<<=$r,$s.=chr (($_&$q)>>$r),$t++}}while($= ||= !$|) {$o=$o?$?:$/;$|=1;print $o?$s:$"x$t if$;;print"\b"x$t;sleep 1} </BLINK>
+----[ Dennis Moore ]--------------------------------------------- | I've got an LDAP method called 'getuser' which simply returns all the | information for a particular userid. This part seems to work ok. I am | having a really weird problem with trying to use the information I get from | it, though: It's not a string.... -- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au|
Dennis Moore wrote:
I've got an LDAP method called 'getuser' which simply returns all the information for a particular userid. This part seems to work ok. I am having a really weird problem with trying to use the information I get from it, though:
<dtml-call "REQUEST.set('userid', 'someone')">
<dtml-in getuser> <dtml-call "REQUEST.set('foo', departmentnumber)"> </dtml-in>
<dtml-if "foo == 'RU168'">
try "_.str(foo) == 'RU168'" foo is probably something that is 'RU168' after converting to string. This conversion is done automatically on output but not when comparing --------------- Hannu
At 08:16 PM 2/2/00 -0600, Dennis Moore wrote:
I've got an LDAP method called 'getuser' which simply returns all the information for a particular userid. This part seems to work ok. I am having a really weird problem with trying to use the information I get from it, though:
<dtml-call "REQUEST.set('userid', 'someone')">
<dtml-in getuser> <dtml-call "REQUEST.set('foo', departmentnumber)"> </dtml-in>
<dtml-if "foo == 'RU168'"> match! <dtml-else> foo .<dtml-var foo>. <p><dtml-var REQUEST> </dtml-if>
This prints: foo .RU168.
So foo is RU168, but the conditional still fails for some reason. Now, if I do virtually the same thing with an SQL method, it works fine (prints "match!"). I can get the results, print them, and compare them. The weird behavior only happens with the data from an LDAP method.
If "departmentnumber" is an LDAP field, it's actually a list. That is, it's a sequence that contains one string, not a string itself. Try: <dtml-call "REQUEST.set('foo', departmentnumber[0])">
participants (4)
-
Andrew Kenneth Milton -
Dennis Moore -
Hannu Krosing -
Phillip J. Eby