Big commit. We now have a respectable command table with built in permission checking. I've commented this pretty well, so see cmdtable.py and cmdhandler.py for more details. There is also some assorted cleanup and an unrelated fix or two resulting from the new Twisted back-end. Note that for the permissions, you will eventually be able to override the codebase's permissions via the web interface for each command.
This commit is contained in:
parent
9746382614
commit
204ef6d4c5
7 changed files with 151 additions and 69 deletions
|
|
@ -35,7 +35,7 @@ class SessionProtocol(StatefulTelnetProtocol):
|
|||
return self.transport.client
|
||||
|
||||
def prep_session(self):
|
||||
#self.server = server
|
||||
self.server = self.factory.server
|
||||
self.address = self.getClientAddress()
|
||||
self.name = None
|
||||
self.uid = None
|
||||
|
|
@ -187,7 +187,7 @@ class SessionProtocol(StatefulTelnetProtocol):
|
|||
cmdhandler.handle(cdat)
|
||||
functions_general.log_infomsg("Login: %s" % (self,))
|
||||
pobject.set_attribute("Last", "%s" % (time.strftime("%a %b %d %H:%M:%S %Y", time.localtime()),))
|
||||
pobject.set_attribute("Lastsite", "%s" % (self.address,))
|
||||
pobject.set_attribute("Lastsite", "%s" % (self.address[0],))
|
||||
self.load_user_channels()
|
||||
|
||||
def msg(self, message):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue