View Full Version : Pre-fill new tix with Windows AD user name
svardaman
10-30-2008, 02:20 PM
Here at my company we want to pre-fill new tickets with the user's name/email of the person logged into the Windows workstation, via NTLM/Active Directory authentication. I have PHP code to do this, and was wondering if there's any interest in adding this functionality to the OSTicket project.
dajaes
10-31-2008, 12:39 AM
I'm very interested in this functionality! I just wish my PHP skills were a bit better so I could be more help. If you could add this functionality my users would be very happy.
Thanks
________
extreme vaporizer review (http://vaporizers.net/extreme-vaporizer)
svardaman
10-31-2008, 12:21 PM
I got it working late yesterday afternoon.
Basically you add one line to the main index page to call a hidden iframe. The iframe page has about 25 lines of code that gets the Windows user name and writes it to a cookie. Because of a peculiar issue with IE, the iframe page needs to be in a subdir. It's a long story; this explains it:
http://www.websina.com/bugzero/kb/browser-ie.html
Then in open.inc.php you read the cookie, and populate username/email in the HTML form. Total code for everything is about 30 lines, and very minor mods to existing code. My internet at work is very restricted. When I get home tonight I'll upload the code somewhere so you can download it.
PS: it works on Apache (Linux/Windows) but not on IIS.
dajaes
11-03-2008, 07:47 PM
Great work! I'm running on a LAMP server so needing Apache wont be an issue.
Please upload the code as soon as you have a chance!
Thanks again
________
Kawasaki VN2000 (http://www.cyclechaos.com/wiki/Kawasaki_VN2000)
gabi_cavaller
11-04-2008, 07:17 AM
Code please :)
Would be awesome !!!
svardaman
11-04-2008, 01:40 PM
Sorry I was a bit late in posting link -- been real busy. Here ya go:
http://ibm.vardaman.org/ntlm/
dajaes
11-05-2008, 12:58 AM
Hey svar,
I installed the files from the zip file, but now I'm getting a prompt asking for a username and password when I open the welcome page. Email address is being populated with @company.com which I have changed to be my correct domain name.
Any ideas?
Thanks for your help
________
volcano vaporizer digital (http://vaporizers.net/volcano-vaporizer)
svardaman
11-05-2008, 12:19 PM
I'll bet you're using Firefox, not IE.
IE does automatic NTLM authentication, and FF by default does not. The user/pass it's asking you for is your standard Windows login - enter it and you'll get in. In IE this is transparent (no user input required).
Better still, change FF to send automatic NTLM authentication for your server. In FF, enter about:config in URL line. Enter ntlm in filter box. Look for the value network.automatic-ntlm-auth.trusted-uris click it, and enter your server name (company.com). From then on, for that server FF will not ask you for user/pass anymore.
dajaes
12-01-2008, 08:46 PM
I've tried it under IE7 and but im getting the same prompt. Something interesting though, I'm being asked for a username and password to connect to the web server, not the domain.
________
volcano vaporizer (http://vaporizer.org/reviews/volcano)
DutchForce
02-20-2009, 08:20 PM
i got the same problem with IE8 Someone get a solution for this?
svardaman
02-23-2009, 12:43 PM
I'm really stunned -- I don't see how in the world you guys are getting the popups. Can someone send me a screenshot?