Last change
on this file since 1267 was
1230,
checked in by kroman0, 15 years ago
|
fix utility. now need request to get info
|
File size:
554 bytes
|
Rev | Line | |
---|
[1121] | 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 | |
---|
[1230] | 12 | def getInfo(self, request): |
---|
[1121] | 13 | """ get info """ |
---|
| 14 | ip = request.get('HTTP_X_FORWARDED_FOR', None) or request.getClientAddr() |
---|
| 15 | ip = ip.split(',')[0] |
---|
| 16 | browser = request.get('HTTP_USER_AGENT',"") |
---|
| 17 | came_from = request.get("cmfrm","None") |
---|
| 18 | return {'ip':ip, 'browser':browser, 'came_from':came_from} |
---|
Note: See
TracBrowser
for help on using the repository browser.