moin1.9.2-theme-vhost.patch 1.22 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
--- a/MoinMoin/config/multiconfig.py	2010-04-03 16:28:21.000000000 +0200
+++ b/MoinMoin/config/multiconfig.py	2010-06-03 18:27:43.000000000 +0200
@@ -855,6 +855,7 @@
 
     ('theme_default', 'modernized',
      "the name of the theme that is used by default (see HelpOnThemes)"),
+    ('theme_vhost', {}, "If a key matches the vhost, forces its value as the theme."),
     ('theme_force', False,
      "if True, do not allow to change the theme"),
 
--- a/MoinMoin/web/contexts.py	2010-06-03 18:29:00.000000000 +0200
+++ b/MoinMoin/web/contexts.py	2010-06-03 18:42:47.000000000 +0200
@@ -10,7 +10,7 @@
 
 import time, inspect, StringIO, sys, warnings
 
-from werkzeug import Headers, http_date, create_environ, redirect, abort
+from werkzeug import Headers, http_date, create_environ, redirect, abort, get_host
 from werkzeug.exceptions import Unauthorized, NotFound
 
 from MoinMoin import i18n, error, user, config, wikiutil
@@ -184,6 +184,9 @@
             theme_name = self.cfg.theme_default
         else:
             theme_name = self.user.theme_name
+        ### HACK SAUVAGE 1/1
+        theme_name = self.cfg.theme_vhost.get(get_host(self.environ), theme_name)
+        ### FIN HACK 1/1
         load_theme_fallback(self, theme_name)