mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-23 06:38:40 +02:00
Some work about #48. This is far from finished.
This commit is contained in:
@@ -24,3 +24,22 @@ def loadmenus():
|
||||
continue
|
||||
result += (u,)
|
||||
return result
|
||||
|
||||
def list_extensions():
|
||||
basedir = "extensions"
|
||||
result = []
|
||||
for d in os.listdir(basedir):
|
||||
if not os.path.isdir("%s/%s" % (basedir, d)):
|
||||
continue
|
||||
isvalid = True
|
||||
for f in ['urls.py', 'main.py', '__init__.py']:
|
||||
if not os.path.exists("%s/%s/%s" % (basedir, d, f)):
|
||||
isvalid = False
|
||||
break
|
||||
if isvalid:
|
||||
module = __import__(d, globals(), locals(), ['main'])
|
||||
try:
|
||||
result += [module.main.infos()]
|
||||
except AttributeError:
|
||||
pass
|
||||
return result
|
||||
|
||||
@@ -24,6 +24,13 @@ from templatetags.amextras import *
|
||||
from mailng.lib.email_listing import parse_search_parameters
|
||||
from sql_listing import *
|
||||
|
||||
def infos():
|
||||
return {
|
||||
"name" : "Amavis quarantine",
|
||||
"version" : "1.0",
|
||||
"description" : _("Simple amavis quarantine management tool")
|
||||
}
|
||||
|
||||
def init():
|
||||
events.register("UserMenuDisplay", menu)
|
||||
parameters.register("amavis_quarantine", "MAX_MESSAGES_AGE", "int", 14,
|
||||
|
||||
@@ -25,6 +25,13 @@ graph_list = [{"name" : "traffic", "label" : _("Average normal traffic")},
|
||||
{"name" : "badtraffic", "label" : _("Average bad traffic")},
|
||||
{"name" : "size", "label" : _("Average normal traffic size")}]
|
||||
|
||||
def infos():
|
||||
return {
|
||||
"name" : "Statistics",
|
||||
"version" : "1.0",
|
||||
"description" : _("Graphical statistics about emails traffic using RRDtool")
|
||||
}
|
||||
|
||||
def init():
|
||||
events.register("AdminMenuDisplay", menu)
|
||||
parameters.register("stats", "LOGFILE", "string", "/var/log/mail.log",
|
||||
|
||||
@@ -34,6 +34,13 @@ def init():
|
||||
parameters.register("webmail", "SMTP_SECURED", "list_yesno", "no",
|
||||
help=_("Use a secured connection to access SMTP server"))
|
||||
|
||||
def infos():
|
||||
return {
|
||||
"name" : "Webmail",
|
||||
"version" : "1.0",
|
||||
"description" : _("Simple IMAP webmail")
|
||||
}
|
||||
|
||||
def urls():
|
||||
return (r'^mailng/webmail/',
|
||||
include('mailng.extensions.webmail.urls'))
|
||||
|
||||
Reference in New Issue
Block a user