[Nym3-commit] r366 - trunk/nymbaron/Server

laurent at conuropsis.org laurent at conuropsis.org
Sun Oct 30 11:06:23 CET 2005


Author: laurent
Date: 2005-10-30 11:06:21 +0100 (Sun, 30 Oct 2005)
New Revision: 366

Modified:
   trunk/nymbaron/Server/Config.py
   trunk/nymbaron/Server/User.py
Log:
Clean some junk. Let the server launch a custom program when an account is
created. Suggested use : welcome message.


Modified: trunk/nymbaron/Server/Config.py
===================================================================
--- trunk/nymbaron/Server/Config.py	2005-10-20 11:20:02 UTC (rev 365)
+++ trunk/nymbaron/Server/Config.py	2005-10-30 10:06:21 UTC (rev 366)
@@ -52,6 +52,10 @@
 			    'HoldSURBs' : 5, 'nSurbs' : 0, 'up' : False,
 			    'cr' : "", 'inidgst' : "" }
 	"""The default settings of a user account."""
+
+	self.setupscript = None
+	"""The path to a script to execute upon successful new account
+	   creation"""
 	
 	if filename:
 	    config = ConfigParser.RawConfigParser()
@@ -64,6 +68,8 @@
 		    self.path = config.get('general', 'path')
 		if config.has_option('general', 'serverName'):
 		    self.serverName = config.get('general', 'serverName')
+		if config.has_option('general', 'setupscript'):
+		    self.setupscript = config.get('general', 'setupscript')
 
 	    if config.has_section('accounts'):
 		for k in self.default_settings.keys():

Modified: trunk/nymbaron/Server/User.py
===================================================================
--- trunk/nymbaron/Server/User.py	2005-10-20 11:20:02 UTC (rev 365)
+++ trunk/nymbaron/Server/User.py	2005-10-30 10:06:21 UTC (rev 366)
@@ -526,6 +526,8 @@
     def setUp(self):
 	"""Sets the up status"""
 	self['up'] = True
+	if self.config.setupscript:
+	    os.system(self.config.setupscript + (" %s" % self.username))
 
     def checkMessageSign(self, m, s):
 	"""Checks s is the signature of message m using sha1, RSA-OAEP and
@@ -640,11 +642,3 @@
 	    self.syn.append(foo)
 	    ret.append(bfprepare(foo))
 	return ret
-
-if __name__ == '__main__':
-    try:
-        a = User('laurent')
-    except NoSuchUser:
-        print "this user does not exist"
-    #ec = a.relay("NYM3 TEST : " + repr(time.time()))
-    #print "Errorcode is " + repr(ec)



More information about the Nym3-commit mailing list