Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Leboulanger <asterix@lagaule.org>2008-07-05 22:07:32 +0400
committerYann Leboulanger <asterix@lagaule.org>2008-07-05 22:07:32 +0400
commit1e636e78241dd1895fd924f9bd6c80c4b0cd6852 (patch)
treeb87a51f02955bc66fe64127b203b8dbabf562c95 /src/gajim.py
parent0671e6c865f65e7b98d3e407517ad6841d869fa4 (diff)
warn before connecting without PyOpenSSL. fixes #4065
Diffstat (limited to 'src/gajim.py')
-rwxr-xr-xsrc/gajim.py45
1 files changed, 37 insertions, 8 deletions
diff --git a/src/gajim.py b/src/gajim.py
index a65bee6a7..48484c8c5 100755
--- a/src/gajim.py
+++ b/src/gajim.py
@@ -1933,20 +1933,48 @@ class Interface:
def handle_event_plain_connection(self, account, data):
# ('PLAIN_CONNECTION', account, (connection))
server = gajim.config.get_per('accounts', account, 'hostname')
- def on_yes(is_checked):
- if is_checked:
+ def on_ok(is_checked):
+ if not is_checked[0]:
+ on_cancel()
+ return
+ if is_checked[1]:
gajim.config.set_per('accounts', account,
- 'warn_when_insecure_connection', False)
+ 'warn_when_plaintext_connection', False)
gajim.connections[account].connection_accepted(data[0], 'tcp')
- def on_no():
+ def on_cancel():
gajim.connections[account].disconnect(on_purpose=True)
self.handle_event_status(account, 'offline')
pritext = _('Insecure connection')
- sectext = _('You are about to send your password on an insecure '
+ sectext = _('You are about to send your password on an unencrypted '
'connection. Are you sure you want to do that?')
- checktext = _('Do _not ask me again')
- dialog = dialogs.YesNoDialog(pritext, sectext, checktext,
- on_response_yes=on_yes, on_response_no=on_no)
+ checktext1 = _('Yes, I really want to connect insecurely')
+ checktext2 = _('Do _not ask me again')
+ dialog = dialogs.ConfirmationDialogDubbleCheck(pritext, sectext,
+ checktext1, checktext2, on_response_ok=on_ok,
+ on_response_cancel=on_cancel, is_modal=False)
+
+ def handle_event_insecure_ssl_connection(self, account, data):
+ # ('INSECURE_SSL_CONNECTION', account, (connection, connection_type))
+ server = gajim.config.get_per('accounts', account, 'hostname')
+ def on_ok(is_checked):
+ if not is_checked[0]:
+ on_cancel()
+ return
+ if is_checked[1]:
+ gajim.config.set_per('accounts', account,
+ 'warn_when_insecure_ssl_connection', False)
+ gajim.connections[account].connection_accepted(data[0], data[1])
+ def on_cancel():
+ gajim.connections[account].disconnect(on_purpose=True)
+ self.handle_event_status(account, 'offline')
+ pritext = _('Insecure connection')
+ sectext = _('You are about to send your password on an insecure '
+ 'connection. You should install PyOpenSSL to prevent that. Are you sure you want to do that?')
+ checktext1 = _('Yes, I really want to connect insecurely')
+ checktext2 = _('Do _not ask me again')
+ dialog = dialogs.ConfirmationDialogDubbleCheck(pritext, sectext,
+ checktext1, checktext2, on_response_ok=on_ok,
+ on_response_cancel=on_cancel, is_modal=False)
def handle_event_pubsub_node_removed(self, account, data):
# ('PUBSUB_NODE_REMOVED', account, (jid, node))
@@ -2037,6 +2065,7 @@ class Interface:
'SSL_ERROR': self.handle_event_ssl_error,
'FINGERPRINT_ERROR': self.handle_event_fingerprint_error,
'PLAIN_CONNECTION': self.handle_event_plain_connection,
+ 'INSECURE_SSL_CONNECTION': self.handle_event_insecure_ssl_connection,
'PUBSUB_NODE_REMOVED': self.handle_event_pubsub_node_removed,
'PUBSUB_NODE_NOT_REMOVED': self.handle_event_pubsub_node_not_removed,
}