Re: Where am I ... Take 2
| From: | Christoph Becker | Date: | Mon, 28 Jul 2014 16:48:50 +0000 |
| Subject: | Re: Where am I ... Take 2 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-323678@lists.php.net to get a copy of this message | ||
Lester Caine wrote:
> Having now worked out the correct questions to ask, I've now discovered
> that the magic value that I need to read via the browser is
>
> HKEY_CURRENT_USER\Volatile Environment\ViewClient_Machine_Name
Um, are you sure that is the correct key? HKEY_CURRENT_*USER* seems
doubtful.
> This will apparently contain the asset number of the machine I need to
> identify. It's IP address will not be contained in the browser header
> since that is provided via the load sharing from a poll of IP addresses
> managed by the VDI system rather than the physical IP address of the
> machine.
>
> I believe that I need the customer to run something on the desktop in
> order to make the variable available via the browser. It can't be read
> direct via javascript?
No, access to the registry is hopefully impossible via browser-side
JavaScript (otherwise that would be a security hole, IMHO).
However, it might not be necessary to "run something" on the desktop; in
the simplest case an appropriate shortcut to "start" the web application
might suffice. If the value of the environment variable COMPUTERNAME
would be okay, it is as simple as:
http://www.example.com/computername=%COMPUTERNAME%
(See
<http://stackoverflow.com/questions/21315708/reading-environment-variables-with-javascript>.)
If you really need to send the value of a registry key, a small batch
script should do the trick.
--
Christoph M. Becker