1
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
2
# See LICENSE for details.
5
"""The Finger User Information Protocol (RFC 1288)"""
7
from twisted.protocols import basic
10
class Finger(basic.LineReceiver):
12
def lineReceived(self, line):
13
parts = string.split(line)
22
host_place = string.rfind(user, '@')
23
user = user[:host_place]
24
host = user[host_place+1:]
25
return self.forwardQuery(slash_w, user, host)
27
return self.getUser(slash_w, user)
29
return self.getDomain(slash_w)
31
def _refuseMessage(self, message):
32
self.transport.write(message+"\n")
33
self.transport.loseConnection()
35
def forwardQuery(self, slash_w, user, host):
36
self._refuseMessage('Finger forwarding service denied')
38
def getDomain(self, slash_w):
39
self._refuseMessage('Finger online list denied')
41
def getUser(self, slash_w, user):
42
self.transport.write('Login: '+user+'\n')
43
self._refuseMessage('No such user')