mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Bugfixes
This commit is contained in:
@@ -162,13 +162,17 @@ class IMAPconnector(object):
|
||||
return False, _("Connection to IMAP server failed, check your configuration")
|
||||
try:
|
||||
self.m.login(user, passwd)
|
||||
except imap
|
||||
except (imaplib.IMAP4.error, ssl.SSLError), error:
|
||||
return False, _("Authentication failed, check your configuration")
|
||||
|
||||
return True, None
|
||||
|
||||
def logout(self):
|
||||
self.m.close()
|
||||
try:
|
||||
self.m.close()
|
||||
except imaplib.IMAP4.error:
|
||||
pass
|
||||
self.m.logout()
|
||||
self.invalid = True
|
||||
|
||||
|
||||
@@ -54,11 +54,15 @@ def menu(**kwargs):
|
||||
def userlogin(**kwargs):
|
||||
from imap_listing import IMAPconnector
|
||||
|
||||
if kwargs["request"].user.id == 1:
|
||||
return
|
||||
m = IMAPconnector(user=kwargs["request"].user.username,
|
||||
password=kwargs["password"])
|
||||
|
||||
def userlogout(**kwargs):
|
||||
from imap_listing import IMAPconnector
|
||||
|
||||
if kwargs["request"].user.id == 1:
|
||||
return
|
||||
m = IMAPconnector(user=kwargs["request"].user.username)
|
||||
m.logout()
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{% extends "layout_simple.html" %}
|
||||
{% block content %}
|
||||
<div class="error"><p>{{ error }}</p></div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user