Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/authentication.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/authentication.py	(revision 13384)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/authentication.py	(revision 13394)
@@ -48,8 +48,13 @@
     def checkPassword(self, password):
         """Check whether the given `password` matches the one stored by
-        students.
-
-        We additionally check if student account has been suspended.
+        students. We additionally check if applicant account has been suspended
+        or if the portal is blocked.
         """
+        try:
+            blocker = grok.getSite()['configuration'].maintmode_enabled_by
+            if blocker:
+                return False
+        except TypeError:  # in unit tests
+            pass
         if not isinstance(password, basestring):
             return False
Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py	(revision 13384)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py	(revision 13394)
@@ -1199,4 +1199,11 @@
         if self.context.expired:
             self.flash(_('Outside application period.'), type='warning')
+            self.redirect(self.url(self.context))
+            return
+        blocker = grok.getSite()['configuration'].maintmode_enabled_by
+        if blocker:
+            self.flash(_('The portal is in maintenance mode '
+                        'and registration temporarily disabled.'),
+                       type='warning')
             self.redirect(self.url(self.context))
             return
Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py	(revision 13384)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py	(revision 13394)
@@ -609,4 +609,24 @@
         self.assertTrue(
             'You logged in.' in self.browser.contents)
+
+    def test_maintenance_mode(self):
+        config = grok.getSite()['configuration']
+        self.login()
+        # Applicant  logged in.
+        self.assertTrue('You logged in' in self.browser.contents)
+        self.assertTrue("Joan None" in self.browser.contents)
+        # If maintenance mode is enabled, applicant is immediately logged out.
+        config.maintmode_enabled_by = u'any_user'
+        self.assertRaises(
+            Unauthorized, self.browser.open, 'http://localhost/app/faculties')
+        self.browser.open('http://localhost/app/login')
+        self.assertTrue('The portal is in maintenance mode' in self.browser.contents)
+        # Applicant really can't login if maintenance mode is enabled.
+        self.login()
+        # A second warning is raised.
+        self.assertTrue(
+            'The portal is in maintenance mode. You can\'t login!'
+            in self.browser.contents)
+        return
 
     def test_applicant_access(self):
@@ -1250,9 +1270,15 @@
 
     def test_register_applicant_create(self):
+        config = grok.getSite()['configuration']
+        config.maintmode_enabled_by = u'any_user'
         self.assertEqual(len(self.app['applicants'][container_name_1]), 1)
         # An applicant can register himself.
         self.browser.open(self.container_path)
         self.browser.getLink("Register for application").click()
-        # Fill the edit form with suitable values
+        self.assertTrue(
+            'The portal is in maintenance mode' in self.browser.contents)
+        config.maintmode_enabled_by = None
+        self.browser.getLink("Register for application").click()
+        # The edit form now opens and can be filled with suitable values
         self.browser.getControl(name="form.firstname").value = 'Anna'
         self.browser.getControl(name="form.lastname").value = 'Kurios'
