Thanks again! This is working well and satisfies our needs for the classic
Swiki function. We are about to turn 200 eighth graders loose in a CoWeb
and we need to track users because it helps us find those who are having
problems and don't know it.
Can this code be incorporated in future releases (default\ddresses\22) please?
Thanks,
Derrel
At 12:21 AM 1/18/2006 +0900, Uchida Yasuo wrote:
It seems that my mailer program can't handle underlines in
a message.
This version uses ':=' instead.
-----
"Get the IP Name (such as minnow.cc.gatech.edu) from the
IP Address (such as 130.207.118.114)"
| ipCache user cacheEntry return ipName username |
ipCache := shelf modulesAt: 'ipCache'.
ipName := (user := request user)
ifNil: ["This sometimes happens during upload requests"
'not available']
ifNotNil: [(cacheEntry := ipCache at: user ifAbsent:
[nil])
ifNil: [(return := NetNameResolver nameForAddress: user
timeout: 15)
ifNil: [NetNameResolver stringFromAddress: user]
ifNotNil: [ipCache at: user put: (Array with: Time
totalSeconds with: return).
return]]
ifNotNil: [((Time totalSeconds - (cacheEntry at: 1)) >
72000)
ifTrue: ["Refresh cache after 20 hours"
ipCache removeKey: user.
(return := NetNameResolver
nameForAddress: user
timeout: 15)
ifNil: [NetNameResolver
stringFromAddress: user]
ifNotNil: [
ipCache at: user put:
(Array with: Time totalSeconds
with: return).
return]]
ifFalse: [cacheEntry at: 2]]].
username := request security ifNotNil: [request security
user] ifNil: ['unknown'].
username, ':', ipName
_______________________________________________
Pws mailing list
[email protected]
https://mailman.cc.gatech.edu/mailman/listinfo/pws