Index: main/waeup.kofa/trunk/src/waeup/kofa/mandates/mandate.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/mandates/mandate.py	(revision 15606)
+++ main/waeup.kofa/trunk/src/waeup/kofa/mandates/mandate.py	(revision 15607)
@@ -82,4 +82,32 @@
         return msg, redirect_path
 
+class ParentsPasswordMandate(Mandate):
+
+    def _setPassword(self):
+        student = self.params.get('student', None)
+        pwd = self.params.get('password', None)
+        if not None in (student, pwd):
+            try:
+                student.setParentsPassword(pwd)
+                return True
+            except:
+                return False
+        return False
+
+    def execute(self):
+        msg = _('Wrong mandate parameters.')
+        redirect_path = ''
+        if self.expires < datetime.utcnow():
+            msg = _('Mandate expired.')
+        elif self._setPassword():
+            msg = _('Parents password has been successfully set. '
+                    'Login with your parents password.')
+            grok.getSite().logger.info(
+                'ParentsPasswordMandate used: %s '
+                % self.params['student'].student_id)
+            redirect_path = '/login'
+        del self.__parent__[self.mandate_id]
+        return msg, redirect_path
+
 class RefereeReportMandate(Mandate):
     """This is a mandate which can unlock a `RefereeReportAddFormPage`.
Index: main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py	(revision 15606)
+++ main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py	(revision 15607)
@@ -32,5 +32,6 @@
     IMandatesContainer, IMandate)
 from waeup.kofa.mandates.container import MandatesContainer
-from waeup.kofa.mandates.mandate import PasswordMandate, RefereeReportMandate
+from waeup.kofa.mandates.mandate import (
+    PasswordMandate, RefereeReportMandate, ParentsPasswordMandate)
 from waeup.kofa.testing import (FunctionalLayer, FunctionalTestCase)
 from waeup.kofa.tests.test_authentication import SECRET
@@ -57,4 +58,20 @@
             verifyObject(
                 IMandate, PasswordMandate())
+            )
+        self.assertTrue(
+            verifyClass(
+                IMandate, RefereeReportMandate)
+            )
+        self.assertTrue(
+            verifyObject(
+                IMandate, RefereeReportMandate())
+            )
+        self.assertTrue(
+            verifyClass(
+                IMandate, ParentsPasswordMandate)
+            )
+        self.assertTrue(
+            verifyObject(
+                IMandate, ParentsPasswordMandate())
             )
         return
@@ -246,2 +263,40 @@
         # Both mandates still exist
         self.assertEqual(len(self.app['mandates'].keys()), 2)
+
+    def test_set_parents_password(self):
+        student = createObject('waeup.Student')
+        # Add and execute a mandate with missing parameters.
+        mandate = ParentsPasswordMandate()
+        self.app['mandates'].addMandate(mandate)
+        (msg, redirect_path) = mandate.execute()
+        self.assertEqual(redirect_path, '')
+        self.assertEqual(msg, u'Wrong mandate parameters.')
+        # Add and execute an expired mandate.
+        mandate = PasswordMandate(days=0)
+        mandate.params['student'] = student
+        mandate.params['password'] = 'mypwd1'
+        self.app['mandates'].addMandate(mandate)
+        (msg, redirect_path) = mandate.execute()
+        self.assertEqual(msg, u'Mandate expired.')
+        self.assertEqual(redirect_path, '')
+        # Password has not been set
+        self.assertEqual(student.getParentsPassword(), None)
+        # Add and execute a perfect mandate
+        mandate = ParentsPasswordMandate()
+        mandate.params['student'] = student
+        mandate.params['password'] = 'mypwd1'
+        self.app['mandates'].addMandate(mandate)
+        (msg, redirect_path) = mandate.execute()
+        # Parents password has been set and must be used for login.
+        self.assertEqual(msg,
+            'Parents password has been successfully set. '
+            'Login with your parents password.')
+        self.assertEqual(redirect_path, '/login')
+        self.assertTrue(IUserAccount(student).checkPassword('mypwd1'))
+        # All mandates have been removed.
+        self.assertEqual(len(self.app['mandates'].keys()), 0)
+        logfile = os.path.join(
+            self.app['datacenter'].storage, 'logs', 'main.log')
+        logcontent = open(logfile).read()
+        self.assertTrue('system - ParentsPasswordMandate used: K1000000'
+                        in logcontent)
