Index: main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py	(revision 6756)
+++ main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py	(revision 6816)
@@ -25,5 +25,7 @@
 import grok
 
-from datetime import datetime
+from datetime import datetime, date
+from zope.authentication.interfaces import ILogout, IAuthentication
+from zope.component import getUtility
 from zope.formlib.widget import CustomWidgetFactory
 from zope.formlib.form import setUpEditWidgets
@@ -412,5 +414,23 @@
         pin = self.request.principal.access_code
 
-        # Mark pin as used (this also fires a pin related transition)
+        # If application has not yet started,
+        # logout without marking AC as used
+        if self.context.startdate > date.today():
+            self.flash('Application has not yet started.')
+            auth = getUtility(IAuthentication)
+            ILogout(auth).logout(self.request)
+            self.redirect(self.url(self.context, 'login'))
+            return
+
+        # If application has ended and applicant record doesn't exist,
+        # logout without marking AC as used
+        if not pin in self.context.keys() and self.context.enddate < date.today():
+            self.flash('Application has ended.')
+            auth = getUtility(IAuthentication)
+            ILogout(auth).logout(self.request)
+            self.redirect(self.url(self.context, 'login'))
+            return
+
+        # Mark AC as used (this also fires a pin related transition)
         if get_access_code(pin).state == USED:
             pass
Index: main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/loginapplicant.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/loginapplicant.pt	(revision 6756)
+++ main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/loginapplicant.pt	(revision 6816)
@@ -50,7 +50,15 @@
   </ul>
 </div>
-<div tal:on-error="nothing">
-  <div class="error" tal:content="view/getDeadline">
-    The deadline is NOW
-  </div>
+<br />
+<div>
+  Start date of application:
+  <span tal:replace="python: context.startdate.strftime('%d/%m/%Y') ">STARTDATE</span>
 </div>
+<div>
+  Closing date of application:
+  <span tal:replace="python: context.enddate.strftime('%d/%m/%Y')">ENDDATE</span>
+</div>
+<br />
+<div tal:condition="context/strict_deadline">
+  No application after deadline!
+</div>
Index: main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py	(revision 6756)
+++ main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py	(revision 6816)
@@ -26,5 +26,5 @@
 import tempfile
 from StringIO import StringIO
-from datetime import datetime
+from datetime import datetime, date, timedelta
 from mechanize import LinkNotFoundError
 from zope.component import createObject
@@ -83,4 +83,7 @@
         applicantscontainer.year = 2009
         applicantscontainer.application_category = 'basic'
+        delta = timedelta(days=10)
+        applicantscontainer.startdate = date.today() - delta
+        applicantscontainer.enddate = date.today() + delta
         self.app['applicants']['app2009'] = applicantscontainer
 
@@ -350,5 +353,4 @@
         appl = appl[pin]
         passp = appl.passport
-        #import pdb; pdb.set_trace()
         passp_len = len(passp.file.read())
         self.assertEqual(passp_len, PH_LEN)
@@ -456,4 +458,7 @@
         applicantscontainer = ApplicantsContainer()
         applicantscontainer.ac_prefix = 'APP'
+        delta = timedelta(days=10)
+        applicantscontainer.startdate = date.today() - delta
+        applicantscontainer.enddate = date.today() + delta
         app['applicants']['testapplicants'] = applicantscontainer
 
@@ -629,4 +634,5 @@
     def test_after_login_default_browsable(self):
         # After login we see the placeholder image in the edit view
+        #import pdb; pdb.set_trace()
         self.login()
         self.assertEqual(self.browser.url, self.edit_path)
