Cooperation/Connection.py

changeset 165
3302a726fd1e
parent 164
b395b006d2a8
child 323
75182cd9b2c5
child 792
a13346916170
diff -r b395b006d2a8 -r 3302a726fd1e Cooperation/Connection.py
--- a/Cooperation/Connection.py	Wed Mar 31 12:52:59 2010 +0000
+++ b/Cooperation/Connection.py	Wed Mar 31 17:11:28 2010 +0000
@@ -175,6 +175,18 @@
                 self.abort()
                 return
             
+            bannedName = "{0}@{1}".format(
+                user, 
+                self.peerAddress().toString()
+            )
+            Preferences.syncPreferences()
+            if bannedName in Preferences.getCooperation("BannedUsers"):
+                self.rejected.emit(
+                    self.trUtf8("* Connection attempted by banned user '{0}'.")\
+                    .format(bannedName))
+                self.abort()
+                return
+            
             if self.__serverPort != self.peerPort() and \
                not Preferences.getCooperation("AutoAcceptConnections"):
                 # don't ask for reverse connections or 

eric ide

mercurial