[Zope] Finding out what Operating System a site visitor is using

Steven Grimes sgrimes@atinucleus.com
Wed, 12 Sep 2001 19:46:28 -0500


Greg,

When I try this code it doesn't display anything. On the plus side this
doesn't crash with a key error. Below I've included a portion of my REQUEST
object for the page. As you can see it includes a value for OS but, when I
try to access it I get a keyerror.

environ
USERPROFILE C:\WINNT\Profiles\Default User
HTTP_ACCEPT_ENCODING gzip, deflate
OS Windows_NT
SERVER_PORT_SECURE 1
LIB
PROCESSOR_LEVEL 6
HTTPS_KEYSIZE 128
SCRIPT_NAME /scripts/zope.pcgi
NUMBER_OF_PROCESSORS 1
REMOTE_HOST 208.239.168.119
HTTP_ACCEPT_LANGUAGE en-us
PCGI_PUBLISHER
GATEWAY_INTERFACE CGI/1.1
ComSpec
PCGI_DISPLAY_ERRORS 1
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/msword, */*
INCLUDE
SystemRoot C:\WINNT
HTTPS on
HTTP_HOST
PCGI_PID_FILE C:\Progra~1\ATIAnywhere\pcgi\pcgi.pid
PCGI_MODULE_PATH C:\Progra~1\ATIAnywhere\lib\python\Main.py
HTTPS_SECRETKEYSIZE 1024
BOBO_REALM Zope
BOBO_DEBUG_MODE 1
HTTPS_SERVER_SUBJECT C=US, S=Alabama, L=Mobile, O=Accelerated Technology,
OU=dbase, OU=Terms of use at www.verisign.com/rpa (c)00,
CN=legacydev.atinucleus.com
PCGI_ERROR_LOG C:\Progra~1\ATIAnywhere\pcgi\pcgi.log
Os2LibPath C:\WINNT\system32\os2\dll;
PCGI_NAME Anywhere
Path
SERVER_PORT 443
PATH_TRANSLATED
INSTANCE_HOME
INSTANCE_ID 1
PROCESSOR_ARCHITECTURE x86
REMOTE_ADDR
SERVER_NAME
HTTP_CONNECTION Keep-Alive
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)
PCGI_PORT 8090
windir C:\WINNT
CONTENT_LENGTH 0
SERVER_PROTOCOL HTTP/1.1
PROCESSOR_REVISION 0502
PATH_INFO /Testing/steven/OSTest
REQUEST_METHOD GET
PROCESSOR_IDENTIFIER x86 Family 6 Model 5 Stepping 2, GenuineIntel
LOCAL_ADDR 208.239.168.53
PCGI_SOCKET_FILE
SERVER_SOFTWARE Microsoft-IIS/4.0
SystemDrive C:
PCGI_EXE
HTTP_COOKIE tree-s="eJzTiFZ3hANPW/VYHU0ALlYElA"; dtpref_rows="20";
dtpref_cols="100"; sql_pref__rows="15"; sql_pref__cols="100"
PCGI_INFO_FILE C:\InetPub\scripts\zope.pcgi
HTTPS_SERVER_ISSUER C=US, O="RSA Data Security, Inc.", OU=Secure Server
Certification Authority
COMPUTERNAME LEGACYDEV


Thanks,
Steven Grimes
Database Engineer
sgrimes@atinucleus.com <mailto:sgrimes@atinucleus.com>

Accelerated Technology, Inc.
720 Oak Circle Drive East
Mobile, AL 36609
TEL*: 251-661-5770
FAX*: 251-661-5788
www.acceleratedtechnology.com <http://www.acceleratedtechnology.com>
*Please note new area code "251"

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Over Ten Years of Providing Embedded Solutions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



-----Original Message-----
From: Gregg Hartling [mailto:hartling@earthlink.net]
Sent: Wednesday, September 12, 2001 7:25 PM
To: sgrimes@atinucleus.com
Cc: Zope
Subject: Re: [Zope] Finding out what Operating System a site visitor is
using


On Wednesday, September 12, 2001, at 05:14 PM, Steven Grimes wrote:

> I need to find out what operating system my clients are using. I know
> this information is available in the REQUEST object but I can not find
> a way to print that information on a page.
>  
> For example:
>  
> <html>
> <body>
> Hello <dtml-var AUTHENTICATED_USER>! You are running {Operating System}.
> </body>
> </html>
>  
> Iwould like the Zope syntax to print the actual operating system used
> in the statement above.
>  

<dtml-var "REQUEST['HTTP_UA_OS']"> works for me.

Sticking <dtml-var REQUEST> into a DTML Method does a nice job of
displaying the data available to you. I put a viewRequest method
containing that tag in my root and reference it frequently.

Gregg.
--
Gregg Hartling
hartling@earthlink.net