Index: main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py	(revision 14009)
+++ main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py	(revision 15250)
@@ -124,4 +124,31 @@
     target = 'statistics'
 
+class ReleaseExpiredAllocationsActionButton(ManageActionButton):
+    grok.order(3)
+    grok.context(IHostelsContainer)
+    grok.view(HostelsContainerPage)
+    grok.require('waeup.manageHostels')
+    icon = 'actionicon_sweep.png'
+    target = 'releaseexpired'
+    text = _('Release all expired bed space allocations')
+
+    @property
+    def target_url(self):
+        if self.target and self.context.allocation_expiration:
+            return self.view.url(self.view.context, self.target)
+        return
+
+    @property
+    def onclick(self):
+        msg = "'All expired bed space allocations will be annulled. " + \
+              "Are you sure? \\n\\n" + \
+              "Bed space allocation expires ${a} days after accommodation " + \
+              "booking if maintenance fee is not " + \
+              "paid.'"
+        msg = _(msg, mapping={'a': self.context.allocation_expiration,})
+        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
+        return "return window.confirm(%s);" % translate(
+            msg, 'waeup.kofa', target_language=portal_language)
+
 class HostelsContainerManagePage(KofaEditFormPage):
     """The manage page for hostel containers.
@@ -190,5 +217,11 @@
     grok.require('waeup.manageHostels')
 
-    def update(self, n=7):
+    def update(self):
+        n = self.context.allocation_expiration
+        if not n:
+            self.flash(
+                _('Forbidden'), type='danger')
+            self.redirect(self.url(self.context))
+            return
         if not grok.getSite()['configuration'].maintmode_enabled_by:
             self.flash(
Index: main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py	(revision 14009)
+++ main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py	(revision 15250)
@@ -73,4 +73,11 @@
         )
 
+    allocation_expiration = schema.Int(
+        title = _(u'Allocation Expiration Time (days)'),
+        description = _(
+            'Number of days after which allocation is being annulled'),
+        required = False,
+        )
+
     def clearAllHostels():
         """Clear all hostels.
Index: main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py	(revision 14009)
+++ main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py	(revision 15250)
@@ -188,4 +188,5 @@
 
     def test_release_expired_allocations(self):
+        self.app['hostels'].allocation_expiration = 7
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
         cat = queryUtility(ICatalog, name='beds_catalog')
