Index: main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 6768)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 6769)
@@ -177,4 +177,5 @@
             invalidate_accesscode(pin,comment)
             IUserAccount(student).setPassword(self.ac_number)
+            student.adm_code = pin
         self.flash('Password has been set. Your Student Id is %s'
             % self.student_id)
@@ -668,13 +669,5 @@
         #    self.flash(self.dataNotComplete())
         #    return
-        state = IWorkflowState(self.context).getState()
-        # This shouldn't happen, but the application officer
-        # might have forgotten to lock the form after changing the state
-        if state != CLEARANCE:
-            self.flash('This form cannot be submitted. Wrong state!')
-            return
-        IWorkflowInfo(self.context).fireTransition('request_clearance')
-        self.flash('Clearance has been requested.')
-        self.redirect(self.url(self.context))
+        self.redirect(self.url(self.context,'request_clearance'))
         return
 
@@ -687,6 +680,7 @@
     label = 'Start clearance'
     ac_prefix = 'CLR'
-    pnav = 4
-    buttonname = 'Start'
+    notice = ''
+    pnav = 4
+    buttonname = 'Start clearance now'
 
     def update(self, SUBMIT=None):
@@ -711,6 +705,39 @@
             # expect an exception
             invalidate_accesscode(pin,comment)
+            self.context.clr_code = pin
         IWorkflowInfo(self.context).fireTransition('start_clearance')
         self.flash('Clearance process is started.')
         self.redirect(self.url(self.context,'cedit'))
         return
+
+class RequestClearance(WAeUPPage):
+    grok.context(IStudent)
+    grok.name('request_clearance')
+    grok.require('waeup.handleStudent')
+    grok.template('enterpin')
+    title = 'Request clearance'
+    label = 'Request clearance'
+    notice = 'Enter the CLR access code used for starting clearance.'
+    ac_prefix = 'CLR'
+    pnav = 4
+    buttonname = 'Request clearance now'
+
+    def update(self, SUBMIT=None):
+        self.ac_series = self.request.form.get('ac_series', None)
+        self.ac_number = self.request.form.get('ac_number', None)
+        if SUBMIT is None:
+            return
+        pin = '%s-%s-%s' % (self.ac_prefix, self.ac_series, self.ac_number)
+        if self.context.clr_code != pin:
+            self.flash("This isn't your CLR access code.")
+            return
+        state = IWorkflowState(self.context).getState()
+        # This shouldn't happen, but the application officer
+        # might have forgotten to lock the form after changing the state
+        if state != CLEARANCE:
+            self.flash('This form cannot be submitted. Wrong state!')
+            return
+        IWorkflowInfo(self.context).fireTransition('request_clearance')
+        self.flash('Clearance has been requested.')
+        self.redirect(self.url(self.context))
+        return
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/enterpin.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/enterpin.pt	(revision 6768)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/enterpin.pt	(revision 6769)
@@ -11,10 +11,14 @@
                value="" tal:attributes="value view/ac_series"/> -
         <input name="ac_number" type="text" size="10" maxlength="10"
-               value="" tal:attributes="value view/ac_number" /></td>
+               value="" tal:attributes="value view/ac_number" />
+        <font color="red"><span tal:replace="view/notice">Notice</span>
+        </font>
+        </td>
       </tr>
       <tr>
         <td colspan="2">
           <input type="submit" name="SUBMIT"
-                 tal:attributes="value view/buttonname" /> </td>
+                 tal:attributes="value view/buttonname" />
+                 </td>
       </tr>
     </tbody>
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py	(revision 6768)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py	(revision 6769)
@@ -91,5 +91,4 @@
     state = Attribute('Returns the registration state of a student')
     password = Attribute('Encrypted password of a student')
-    adm_code = Attribute('Admission checking access code')
 
     def loggerInfo(ob_class, comment):
@@ -122,4 +121,11 @@
         )
 
+    adm_code = schema.TextLine(
+        title = u'PWD access code',
+        default = u'',
+        required = False,
+        readonly = True,
+        )
+
 class IStudentClearance(IWAeUPObject):
     """Representation of student clearance data.
@@ -136,4 +142,11 @@
         )
 
+    clr_code = schema.TextLine(
+        title = u'CLR access code',
+        default = u'',
+        required = False,
+        readonly = True,
+        )
+
 class IStudentPersonal(IWAeUPObject):
     """Representation of student personal data.
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/student.py	(revision 6768)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/student.py	(revision 6769)
@@ -47,5 +47,4 @@
             self.student_id = u'Z654321'
         self.password = None
-        self.adm_code = None
         return
 
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 6768)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 6769)
@@ -401,5 +401,5 @@
         self.browser.getControl(name="ac_series").value = self.existing_clrseries
         self.browser.getControl(name="ac_number").value = self.existing_clrnumber
-        self.browser.getControl("Start").click()
+        self.browser.getControl("Start clearance now").click()
         self.assertMatches('...Clearance process is started...',
                            self.browser.contents)
@@ -411,4 +411,7 @@
         self.browser.getLink("Edit").click()
         self.browser.getControl("Save and request clearance").click()
+        self.browser.getControl(name="ac_series").value = self.existing_clrseries
+        self.browser.getControl(name="ac_number").value = self.existing_clrnumber
+        self.browser.getControl("Request clearance now").click()
         self.assertMatches('...Clearance has been requested...',
                            self.browser.contents)
