HelpSpot Help Desk Software | HelpSpot Blog | HelpSpot Support

Live Lookup from LDAP/AD


#1

I have looked at the document concerning Live Lookup here: http://www.helpspot.com/helpdesk/index.php?pg=kb.page&id=6

I have looked at the live_lookup_ad_and_ldap.php example script. However, I am not clear on where I need to put this script. Can I save this somewhere on the Helpspot server and add in the relevant variables to allow the script to connect to our AD server? If so where would you recommend we place such custom scripts within the Helpspot installation?

Thanks.


#2

Yes that usually works fine. We’d recommend you save it in /custom_code

That assumes you’re AD server can be connected to from the HelpSpot server.


#3

Well I have saved this to the custom_code folder but still having problems. I put in a surname when doing a new request, go to the live lookup tab and then get a progress bar for about a second and then a message:

An Error Occurred
XML Parser Returned Error: Undeclared entity warning (27)
Source Path: /custom_code/live_lookup_ad_and_ldap.php
Call Type: http
View XML

I have tried going direct to the URL myself: /custom_code/live_lookup_ad_and_ldap.php?last_name=Smith but I get a 404 error.

I also tried this url: /custom_pages/example.php as I noticed the custom_pages/example.php file on the server but this returns a 404 error as well.

This is installed on Windows 2008 R2 Server with IIS. Any ideas why these php files return 404 and is that why I get the undeclared entity warning?


#4

It doesn’t look like you have the correct URL or you wouldn’t be getting a 404. That’s not from HelpSpot but from your web server.

Also I removed your URLs from your post as if you eventually get them working anyone would be able to query your system (unless you have other protections but since I don’t know if you do I changed them)


#5

Yes, I left the /helpspot/ part out of the path. Thanks for your precautions regarding the URL, the system isn’t accessible externally so I had no worries about that.

I then had to change the DN to DC in the $dn variable definition, as noted in the comment above this line in the live_lookup_ad_and_ldap.php file. When it was DN I got an error “XML Parser Returned Error: Not well-formed (invalid token) (4)” and the XML contained: “PHP Warning: ldap_search(): Search: Operations error in C:\Program Files (x86)\helpspot\helpspot\custom_code\live_lookup_ad_and_ldap.php on line 64”.

It is now all working as intended. Thanks for your help.


#6

I have just been looking at modifying the live_lookup_ad_and_ldap.php script and I have managed to modify it to look up additional information from Active Directory (e.g. department). I see in your documentation you suggest that information retrived by Live Lookup can be used to fill in Custom Fields. This raises a feq questions:

  1. How does helpspot link the data returned by live lookup to custom fields? Does the XML tag name have to match up with the custom field name? If so is this case sensitive and do spaces cause any problems?
  2. What if the Live Lookup returns a value not listed in a custome field’s predefined list?
  3. Any general rules about what kind of custom fields can be populated by Live Lookup queries?

Thanks.


#7

Ah great Richard!

  1. It has to match the custom field ID. So the tags would be like: data

  2. Then it won’t be able to select it. For predefined lists you’ll want it to match. You could use the HS API to get the values for the list though this will cause the entire LL process to take a bit longer to run. It’s also in a serialized variable in the database which would be faster to run if you wanted to go that route.

  3. Pretty much all of them can be populated given the correct syntax back.