mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Don't propose all extensions for top redirection.
This commit is contained in:
@@ -17,12 +17,16 @@ def enabled_applications():
|
||||
:return: a list
|
||||
"""
|
||||
from modoboa.core.models import Extension
|
||||
from modoboa.core.extensions import exts_pool
|
||||
from modoboa.lib.dbutils import db_table_exists
|
||||
|
||||
result = [("user", "user")]
|
||||
if db_table_exists("core_extension"):
|
||||
exts = Extension.objects.filter(enabled=True)
|
||||
result += [(ext.name, ext.name) for ext in exts]
|
||||
for ext in exts:
|
||||
extclass = exts_pool.get_extension(ext.name)
|
||||
if extclass.available_for_topredirection:
|
||||
result.append((ext.name, ext.name))
|
||||
return sorted(result, key=lambda e: e[0])
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ class ModoExtension(object):
|
||||
url = None
|
||||
needs_media = False
|
||||
always_active = False
|
||||
available_for_topredirection = False
|
||||
|
||||
def infos(self):
|
||||
return dict(
|
||||
|
||||
@@ -21,6 +21,7 @@ class Amavis(ModoExtension):
|
||||
version = "1.0"
|
||||
description = ugettext_lazy("Simple amavis management frontend")
|
||||
url = "quarantine"
|
||||
available_for_topredirection = True
|
||||
|
||||
def init(self):
|
||||
"""Init function
|
||||
|
||||
@@ -11,6 +11,7 @@ class SieveFilters(ModoExtension):
|
||||
version = "1.0"
|
||||
description = ugettext_lazy("Plugin to easily create server-side filters")
|
||||
url = "sfilters"
|
||||
available_for_topredirection = True
|
||||
|
||||
def load(self):
|
||||
from .app_settings import ParametersForm, UserSettings
|
||||
|
||||
@@ -11,6 +11,7 @@ class Webmail(ModoExtension):
|
||||
version = "1.0"
|
||||
description = ugettext_lazy("Simple IMAP webmail")
|
||||
needs_media = True
|
||||
available_for_topredirection = True
|
||||
|
||||
def load(self):
|
||||
from .app_settings import ParametersForm, UserSettings
|
||||
|
||||
Reference in New Issue
Block a user