Hello all,<div><br></div><div>I am fairly new to Drupal, so this may be a simple thing that I am just not doing right. I apologize for what will be a long winded email, but I want to make sure I explain it right. Here goes:</div>
<div><br></div><div>I am using Drupal 7 with LDAP 7.x-1.0-beta5 (latest stable as of 12/27/11) and would like to use an attribute in LDAP as a variable for a URL. I have Drupal attached to my LDAP server (W2K3 AD) and I can run the manual "test" query on the AD server and see the list of attributes it pulls back (Configuration -> LDAP configuration -> Servers -> Test -> test). It looks something like:</div>
<div><br></div><div>objectclass 0 top [objectclass:0] </div><div>objectclass 1 person [objectclass:1] </div><div>objectclass 2 organizationalPerson [objectclass:2] </div>
<div>objectclass 3 user [objectclass:last]</div><div><snip></div><div>mail 0 <a href="mailto:john.doe@email.com">john.doe@email.com</a> [mail]</div><div>displayname 0 john doe [displayname] </div>
<div>usncreated 0 37151 [usncreated] </div><div>info 0 John.Doe.foo [info]</div><div><br></div><div><br></div><div>So when I create my link I use something along the lines of:</div>
<div><br></div><div>> <a href="https://www.mysite.com/field1=[current-user:mail]">https://www.mysite.com/field1=[current-user:mail]</a></div><div><br></div><div>And when the user clicks the link it resolves to:</div>
<div><br></div><div>> <a href="https://www.mysite.com/field1=john.doe@email.com">https://www.mysite.com/field1=john.doe@email.com</a></div><div><br></div><div>That is exactly what I want it to do, but the trick is I want to use the [info] token from LDAP rather than the [mail] token from the local user database. If I do as the documentation says (<a href="http://drupal.org/node/1245736">http://drupal.org/node/1245736</a>) and change the link with using [info] it looks like:</div>
<div><br></div><div>> <a href="https://www.mysite.com/field1=[info]">https://www.mysite.com/field1=[info]</a></div><div><br></div><div>Then when the user clicks the link it still shows:</div><div><br></div><div>> <a href="https://www.mysite.com/field1=[info]">https://www.mysite.com/field1=[info]</a></div>
<div><br></div><div>This is where I would expect it to resolve to '<a href="https://www.mysite.com/field1=John.Doe.foo">https://www.mysite.com/field1=John.Doe.foo</a>' </div><div><br></div><div>Now this isn't just happing with [info] most of the others don't work either. I even tried [cn] which is specifically listed on their example, but that doesn't work etiher. Now I am just guessing at ways to pull this token down. I have tried using:</div>
<div><br></div><div>[current-user:info]</div><div>[current-user:ldap:info]</div><div>[ldap:info]</div><div>[info]</div><div><br></div><div>And none of those will resolve to anything.</div><div><br></div><div>This is all without the 'token' module being enabled. I have played with that, and if I do enable that module I can see that there is a [current-user:mail] token showing. However, it doesn't seem to pull anything from LDAP at all. I have been able to get this working when I am using the CAS module and CAS Attributes, but my production box will not have CAS available so I can't use that one. But for sake of giving too much information the link looks like this when it works with CAS:</div>
<div><br></div><div>> <a href="https://www.mysite.com/field1=[current-user:cas:ldap:info]">https://www.mysite.com/field1=[current-user:cas:ldap:info]</a></div><div><br></div><div>So that leads me to my short question:</div>
<div><br></div><div>How do I properly pull a token from LDAP to pass into a URL?</div><div><br></div><div><br></div><div>Thanks in advance,</div><div>Chad</div>