[Javascript] getenv=("USERNAME")
Nick Fitzsimons
nick at jellyfishcreative.co.uk
Wed Oct 13 08:26:37 CDT 2004
On 8 Oct 2004, at 12:23, Scott Hamm wrote:
> At bootup, my Intranet workstations %USERNAME% variable got assigned to
> user's account name i.e. ScottHam, and I would like for my web site to
> acquire %USERNAME% into php's variable $USERNAME, how do I get around
> to it
> using JavaScript? The plan here is to acquire %USERNAME%, look up in
> NTLogon database, acquire the full name then return with greeting on
> the web
> using php.
>
Can't be done, AFAIK, in JavaScript, even if your intranet is set up to
be in the Trusted or Intranet security zones. You can do something
similar in ASP if the wind's in the right direction; specifically: the
Request.ServerVariables("LOGON_USER") variable will contain the
username, if the site is set up to deny anonymous access and use
Windows NT security, and your ASP could then call ADSI (Active
Directory Services Interface, IIRC) to get the info you want; I don't
know if there's any similar approach available in PHP (although, as it
runs as an ISAPI filter, it should be possible), but I've now gone
wildly off topic, so I'll shut up :-)
Regards,
Nick Fitzsimons.
--
Nick Fitzsimons, IT Manager
Jellyfish Creative, Northampton, UK
nick at jellyfishcreative.co.uk
http://www.jellyfishcreative.co.uk
More information about the Javascript
mailing list