mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
* Some strings were not detected by makemessages (for example in javascript files, behind comments...). There are still some issues with that but I think I'll have to wait a future Django release. * Support for per-user language selection is almost done. see #166
18 lines
489 B
Python
18 lines
489 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
import re
|
|
from django.http import Http404
|
|
from modoboa.admin.models import Extension
|
|
|
|
class ExtControlMiddleware(object):
|
|
def process_view(self, request, view, args, kwargs):
|
|
m = re.match("modoboa\.extensions\.(\w+)", view.__module__)
|
|
if m is None:
|
|
return None
|
|
ext = Extension.objects.get(name=m.group(1))
|
|
if ext is None:
|
|
return None
|
|
if ext.enabled:
|
|
return None
|
|
raise Http404
|