Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py	(revision 8032)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py	(revision 8033)
@@ -24,4 +24,5 @@
 from datetime import datetime, date
 from zope.component import getUtility, createObject, getAdapter
+from zope.catalog.interfaces import ICatalog
 from zope.i18n import translate
 from hurry.workflow.interfaces import (
@@ -30,5 +31,6 @@
     IApplicant, IApplicantEdit, IApplicantsRoot,
     IApplicantsContainer, IApplicantsContainerAdd,
-    MAX_UPLOAD_SIZE, IApplicantOnlinePayment, IApplicantsUtils
+    MAX_UPLOAD_SIZE, IApplicantOnlinePayment, IApplicantsUtils,
+    IApplicantUpdateByRegNo
     )
 from waeup.kofa.applicants.workflow import INITIALIZED, STARTED, PAID, SUBMITTED
@@ -858,7 +860,16 @@
     grok.require('waeup.Anonymous')
     grok.template('applicantregister')
-    form_fields = grok.AutoFields(IApplicantEdit).select(
-        'firstname', 'middlename', 'lastname', 'email', 'phone')
-    form_fields['phone'].custom_widget = PhoneWidget
+
+    @property
+    def form_fields(self):
+        form_fields = None
+        if self.context.mode == 'create':
+            form_fields = grok.AutoFields(IApplicantEdit).select(
+                'firstname', 'middlename', 'lastname', 'email', 'phone')
+            form_fields['phone'].custom_widget = PhoneWidget
+        elif self.context.mode == 'update':
+            form_fields = grok.AutoFields(IApplicantUpdateByRegNo).select(
+                'reg_number','email')
+        return form_fields
 
     @property
@@ -890,8 +901,26 @@
             # No need to flash something.
             return
-        # Add applicant and create password
-        applicant = createObject(u'waeup.Applicant')
-        self.applyData(applicant, **data)
-        self.context.addApplicant(applicant)
+        if self.context.mode == 'create':
+            # Add applicant
+            applicant = createObject(u'waeup.Applicant')
+            self.applyData(applicant, **data)
+            self.context.addApplicant(applicant)
+        elif self.context.mode == 'update':
+            # Update applicant
+            reg_number = data['reg_number']
+            cat = getUtility(ICatalog, name='applicants_catalog')
+            results = list(
+                cat.searchResults(reg_number=(reg_number, reg_number)))
+            if results:
+                applicant = results[0]
+                if applicant.password is not None:
+                    self.flash(_('Your password has already been set.'))
+                    return
+                applicant.email = data['email']
+            else:
+                self.flash(_('No application record found.'))
+                return
+        else:
+            return
         kofa_utils = getUtility(IKofaUtils)
         password = kofa_utils.genPassword()
Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantregister.pt
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantregister.pt	(revision 8032)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantregister.pt	(revision 8033)
@@ -16,6 +16,10 @@
     </tbody>
   </table>
-  <p i18n:translate="">
+  <p i18n:translate="" tal:condition="python: context.mode=='create'">
     An account will be created for you and an email with your login
+    credentials will be sent to the address provided.
+  </p>
+  <p i18n:translate="" tal:condition="python: context.mode=='update'">
+    Your application record will be looked up and an email with your login
     credentials will be sent to the address provided.
   </p>
Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py	(revision 8032)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py	(revision 8033)
@@ -29,5 +29,6 @@
 from waeup.kofa.schema import TextLineChoice
 from waeup.kofa.interfaces import (
-    IKofaObject, year_range, validate_email, academic_sessions_vocab)
+    IKofaObject, year_range, validate_email, academic_sessions_vocab,
+    SimpleKofaVocabulary)
 from waeup.kofa.interfaces import MessageFactory as _
 from waeup.kofa.payments.interfaces import IOnlinePayment
@@ -135,4 +136,8 @@
 #            apppins_dict[value][1],self.apppins_dict[value][0])
 
+application_modes_vocab = SimpleKofaVocabulary(
+    (_('Create Application Records'), 'create'),
+    (_('Update Application Records'), 'update'),
+    )
 
 class IApplicantsUtils(Interface):
@@ -176,4 +181,10 @@
         values = year_range(),
         readonly = True,
+        )
+
+    mode = schema.Choice(
+        title = _(u'Application Mode'),
+        vocabulary = application_modes_vocab,
+        required = True,
         )
 
@@ -202,5 +213,5 @@
         required = False,
         default = u'''This text can been seen by anonymous users.
-Here we put mult-lingual information about the study courses provided, the application procedure and deadlines.
+Here we put multi-lingual information about the study courses provided, the application procedure and deadlines.
 >>de<<
 Dieser Text kann von anonymen Benutzern gelesen werden.
@@ -298,5 +309,5 @@
         )
     reg_number = TextLineChoice(
-        title = _(u'JAMB Registration Number'),
+        title = _(u'Registration Number'),
         readonly = False,
         required = True,
@@ -337,5 +348,5 @@
     email = schema.ASCIILine(
         title = _(u'Email Address'),
-        required = True,
+        required = False,
         constraint=validate_email,
         )
Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_container_data.csv
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_container_data.csv	(revision 8032)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_container_data.csv	(revision 8033)
@@ -1,7 +1,7 @@
-code,title,prefix,entry_level,year,provider,application_category,description,startdate,enddate,strict_deadline
-app2012,General Studies 2012/2013,app,100,2012,waeup.kofa.applicants.ApplicantsContainer,basic,"This text can been seen by anonymous users.
+code,title,prefix,entry_level,year,application_category,description,startdate,enddate,strict_deadline,mode
+app2012,General Studies 2012/2013,app,100,2012,basic,"This text can been seen by anonymous users.
 >>de<<
-Dieser Text kann von anonymen Benutzern gelesen werden.",2012-03-01,2012-04-25,1
-app2013,General Studies 2013/2014,app,100,2012,waeup.kofa.applicants.ApplicantsContainer,basic,"This text can been seen by anonymous users.
+Dieser Text kann von anonymen Benutzern gelesen werden.",2012-03-01,2012-04-25,1,create
+app2013,General Studies 2013/2014,app,100,2012,basic,"This text can been seen by anonymous users.
 >>de<<
-Dieser Text kann von anonymen Benutzern gelesen werden.",2013-03-01,2013-04-25,1
+Dieser Text kann von anonymen Benutzern gelesen werden.",2013-03-01,2013-04-25,1,create
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 8032)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py	(revision 8033)
@@ -84,4 +84,5 @@
         applicantscontainer.entry_level = 100
         applicantscontainer.application_category = 'basic'
+        applicantscontainer.mode = 'create'
         delta = timedelta(days=10)
         applicantscontainer.startdate = date.today() - delta
@@ -248,4 +249,5 @@
         self.browser.getControl(name="form.year").value = ['2010']
         self.browser.getControl(name="form.entry_level").value = ['100']
+        self.browser.getControl(name="form.mode").value = ['create']
         self.browser.getControl(
             name="form.application_category").value = ['basic']
@@ -262,4 +264,5 @@
         self.browser.getControl(name="form.year").value = ['2010']
         self.browser.getControl(name="form.entry_level").value = ['100']
+        self.browser.getControl(name="form.mode").value = ['create']
         self.browser.getControl(
             name="form.application_category").value = ['basic']
@@ -276,4 +279,5 @@
         self.browser.getControl(name="form.year").value = ['2010']
         self.browser.getControl(name="form.entry_level").value = ['100']
+        self.browser.getControl(name="form.mode").value = ['create']
         #self.browser.getControl(name="form.ac_prefix").value = ['APP']
         self.browser.getControl(
@@ -788,5 +792,5 @@
     layer = FunctionalLayer
 
-    def test_register_applicant(self):
+    def test_register_applicant_create(self):
         # An applicant can register himself.
         self.browser.open(self.container_path)
@@ -802,4 +806,32 @@
         self.assertEqual(self.browser.url,
             self.container_path + '/registration_complete?email=xx%40yy.zz')
+        # Now we change the application mode and check if applicants
+        # can find and update imported records instead of creating new records.
+        # First we check what happens if record can't be found.
+        self.applicantscontainer.mode = 'update'
+        self.browser.open(self.container_path + '/register')
+        #self.browser.getControl(name="form.firstname").value = 'John'
+        self.browser.getControl(name="form.reg_number").value = 'anynumber'
+        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
+        self.browser.getControl("Get login credentials").click()
+        self.assertTrue('No application record found.'
+            in self.browser.contents)
+        # Now we check if password has already been set.
+        #self.browser.getControl(name="form.firstname").value = 'John'
+        self.browser.getControl(name="form.reg_number").value = '1234'
+        self.browser.getControl("Get login credentials").click()
+        self.assertTrue('Your password has already been set.'
+            in self.browser.contents)
+        # We unset the password and try to register again.
+        IUserAccount(
+            self.app['applicants']['app2009'][
+            self.applicant.application_number]).context.password = None
+        self.browser.open(self.container_path + '/register')
+        #self.browser.getControl(name="form.firstname").value = 'John'
+        self.browser.getControl(name="form.reg_number").value = '1234'
+        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
+        self.browser.getControl("Get login credentials").click()
+        self.assertTrue('Your registration was successful.'
+            in self.browser.contents)
         return
 
