Last change
on this file since 1121 was
1121,
checked in by kroman0, 15 years ago
|
Updated quintagroup.camefrominfo package
|
File size:
588 bytes
|
Line | |
---|
1 | from interfaces import ICameFromInfoUtility |
---|
2 | from zope.interface import implements |
---|
3 | |
---|
4 | class CameFromInfoUtility(object): |
---|
5 | """ |
---|
6 | """ |
---|
7 | implements(ICameFromInfoUtility) |
---|
8 | |
---|
9 | def __init__(self): |
---|
10 | pass |
---|
11 | |
---|
12 | def getInfo(self, context): |
---|
13 | """ get info """ |
---|
14 | request = context.REQUEST |
---|
15 | ip = request.get('HTTP_X_FORWARDED_FOR', None) or request.getClientAddr() |
---|
16 | ip = ip.split(',')[0] |
---|
17 | browser = request.get('HTTP_USER_AGENT',"") |
---|
18 | came_from = request.get("cmfrm","None") |
---|
19 | return {'ip':ip, 'browser':browser, 'came_from':came_from} |
---|
Note: See
TracBrowser
for help on using the repository browser.