Index: WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py	(revision 1149)
+++ WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py	(revision 1151)
@@ -37,5 +37,10 @@
         students = context.portal_url.getPortalObject().campus.students
         student = getattr(students,str(member))
-        student_app = getattr(student,'application')
+        if request.has_key('email'):
+            context.waeup_tool.makeStudentData(str(member),email=request.get("email"))
+        student_app = getattr(student,'application',None)
+        if student_app is None:
+            context.waeup_tool.makeStudentData(str(member))
+        student_app = getattr(student,'application',None)
         student_pume = getattr(student,'pume',None)
         s_review_state = wftool.getInfoFor(student,'review_state',None)
Index: WAeUP_SRP/trunk/skins/waeup_default/waeup_edit.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/waeup_edit.py	(revision 1149)
+++ WAeUP_SRP/trunk/skins/waeup_default/waeup_edit.py	(revision 1151)
@@ -71,4 +71,6 @@
                                               sex = ds.get('sex'),
                                              )
+    elif context.portal_type == "Course":
+        context.courses_catalog.modifyRecord(**ds)
     if cpsdocument_edit_and_view_button is not None:
         action = ''
Index: WAeUP_SRP/trunk/skins/waeup_student/createStudentFT.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/createStudentFT.py	(revision 1151)
+++ WAeUP_SRP/trunk/skins/waeup_student/createStudentFT.py	(revision 1151)
@@ -0,0 +1,47 @@
+## Script (Python) "deleteAllCourses"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=matric_no=None
+##title=
+##
+# $Id$
+''' create the Studenbase folder'''
+
+
+pm = context.portal_membership
+member = pm.getAuthenticatedMember()
+wftool = context.portal_workflow
+students_folder = context.portal_url.getPortalObject().campus.students
+import logging
+logger = logging.getLogger('createStudentFT')
+
+if str(member) not in ("henrik","joachim"):
+    return "not possible"
+if not matric_no:
+    return "No matric_no"
+
+if context.students_catalog(matric_no=matric_no):
+    return "Student with %s already exists" % matric_no
+res = context.returning_import(matric_no = matric_no)
+if len(res) != 1:
+    return "Matricel No %s not found in Returning Table" % matric_no
+student_brain = res[0]
+sid = context.waeup_tool.generateStudentId(student_brain.Lastname[0])
+students_folder.invokeFactory('Student', sid)
+logger.info('"%s","Created Student","%s", "%s" ' % (member,sid,matric_no))
+student = getattr(students_folder,sid)
+wftool.doActionFor(student,'clear_and_validate')
+student.manage_setLocalRoles(sid, ['Owner',])
+context.students_catalog.addRecord(id = sid,
+                                   matric_no = matric_no,
+                                   jamb_reg_no = student_brain.Entryregno,
+                                   sex = student_brain.Sex == "F",
+                                   name = "%s %s %s" % (student_brain.Firstname,
+                                                        student_brain.Middlename,
+                                                        student_brain.Lastname)
+                                )
+return "Student MatricelNo %s and %s created" % (matric_no,sid)
+    
Index: WAeUP_SRP/trunk/skins/waeup_student/display_session_results.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/display_session_results.py	(revision 1149)
+++ WAeUP_SRP/trunk/skins/waeup_student/display_session_results.py	(revision 1151)
@@ -15,5 +15,5 @@
 
 res,psm,ds = lt.renderLayout(layout_id= 'student_session_results_search',
-                      schema_id= 'student_clearance',
+                      schema_id= 'student_returning',
                       context=context,
                       mapping=validate and REQUEST,
@@ -40,4 +40,6 @@
                                  )
 elif psm == 'valid':
+##    context.waeup_tool.makeStudent(ds.get('student'),
+##                                   results=ds.get('results'))
     return context.session_results_anon_view(student=ds.get('student'),
                                            results=ds.get('results'))
Index: WAeUP_SRP/trunk/skins/waeup_student/display_session_results_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/display_session_results_form.pt	(revision 1149)
+++ WAeUP_SRP/trunk/skins/waeup_student/display_session_results_form.pt	(revision 1151)
@@ -1,15 +1,15 @@
 <tal:block define="rendered_main options/rendered;
-                   portal_status_message options/psm;
-                   data_storage options/ds;
-                   edition python:1;"
+           portal_status_message options/psm;
+           data_storage options/ds;
+           edition python:1;"
+           >
+  <metal:block define-macro="edit_form">
+    <metal:block use-macro="here/content_lib_master/macros/master">
+      <metal:block fill-slot="header"
+                   tal:define="creation creation|nothing;
+                   edition edition|nothing;
+                   metadata metadata|nothing"
                    >
-<metal:block define-macro="edit_form">
-  <metal:block use-macro="here/content_lib_master/macros/master">
-  <metal:block fill-slot="header"
-    tal:define="creation creation|nothing;
-                edition edition|nothing;
-                metadata metadata|nothing"
-                >
-    </metal:block>
+      </metal:block>
       <metal:block fill-slot="main">
         <h3>Display Your 2005/2006 Session Results! </h3>
Index: WAeUP_SRP/trunk/skins/waeup_student/layout_search_session_edit.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/layout_search_session_edit.pt	(revision 1151)
+++ WAeUP_SRP/trunk/skins/waeup_student/layout_search_session_edit.pt	(revision 1151)
@@ -0,0 +1,84 @@
+<tal:block define="global creation python:0;
+                   global formaction string:set_access_data" />
+<!-- a layout_lib macro -->
+<!-- $Id$ -->
+
+<metal:block define-macro="default_edit"
+  tal:define="layout options/layout;
+  ds options/datastructure;
+  dm ds/getDataModel;
+  formaction options/formaction;
+  matric_no options/matric_no|nothing;
+  creation creation|nothing;
+  cpsmcat nocall:here/translation_service;
+  ">
+  <form action="" id="editForm" method="post" 
+        enctype="multipart/form-data" class="workflow"
+        tal:attributes="action formaction"
+        >
+<input type="hidden" name="matric_no" tal:attributes="value matric_no"/>
+  <table class="layoutDefault" summary="Form layout"
+         tal:condition="layout/rows">
+    <span tal:repeat="row python: layout['rows']" valign="top" >
+      <span tal:repeat="cell row">
+        <tr tal:define="widget cell/widget;
+              wid widget/getWidgetId;
+              err python:ds.getError(wid);
+              err_mapping python:ds.getErrorMapping(wid);
+              is_required python: widget.is_required and creation and ('create' not in widget.readonly_layout_modes);
+              tooltip_id python:wid + '_help';
+              widget_css_class cell/widget_css_class|nothing;
+              css_class python:test(err, 'row error','row')"
+              tal:condition="python: wid != 'passport'"
+              >
+          <div tal:attributes="class widget_css_class;
+          id python:widget.getHtmlWidgetId()+'_widget';"
+          >
+            <td>
+            <div class="label" tal:condition="widget/label_edit"
+                 tal:attributes="class python:test(is_required, 'label required','label')">
+              <label tal:content="widget/label_edit"
+                     tal:attributes="for cell/widget_input_area_id|nothing;">label</label>:
+            </div>
+            <button type="button" class="tooltipControl"
+                    tal:condition="widget/help"
+                    tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button>
+            </td>
+            <td>
+            <span class="field">
+              <div tal:replace="structure cell/widget_rendered"/>
+            </span>
+            <div class="tooltipArea" style="visibility: hidden;"
+                 tal:condition="widget/help"
+                 tal:attributes="id tooltip_id;
+                 onclick python:'showElement(false, \'%s\')' % tooltip_id;"
+                 >
+              <tal:block tal:content="widget/help">This is the help for this field
+              </tal:block>
+            </div>
+            <tal:block condition="err">
+              <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)">
+                <br /><em style="color: red"
+                          tal:content="msg">err</em>
+              </tal:block>
+            </tal:block>
+            </td>
+          </div>
+        </tr>
+      </span>
+    </span>
+  </table>
+  <br />
+  <input type="submit" class="standalone" name="cpsdocument_edit_button"
+         value="Save" 
+         id="cpsdocument_edit_button"
+         tal:condition="not:creation" />
+  <input type="submit" 
+         class="standalone" 
+         name="cpsdocument_create_button"
+         value="apply"
+         tal:attributes="value options/button"
+         tal:condition="creation" />
+
+</form>
+</metal:block>
Index: WAeUP_SRP/trunk/skins/waeup_student/session_results_anon_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/session_results_anon_view.pt	(revision 1149)
+++ WAeUP_SRP/trunk/skins/waeup_student/session_results_anon_view.pt	(revision 1151)
@@ -52,4 +52,5 @@
         </span>
       </table>
+      <a href="" tal:attributes="href string:${context/absolute_url}/set_access_data?matric_no=${student/matric_no}">Continue to Email-entry</a>
     </metal:main>
   </metal:body>
Index: WAeUP_SRP/trunk/skins/waeup_student/set_access_data.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/set_access_data.py	(revision 1151)
+++ WAeUP_SRP/trunk/skins/waeup_student/set_access_data.py	(revision 1151)
@@ -0,0 +1,68 @@
+##parameters=REQUEST,matric_no
+# $Id$
+"""
+process the Application Form
+return html renderer + psm
+"""
+import DateTime
+current = DateTime.DateTime()
+pr = context.portal_registration
+
+validate = REQUEST.has_key("cpsdocument_edit_button")
+
+lt = context.portal_layouts
+#pr = context.portal_registration
+default = {'matric_no':matric_no}
+res,psm,ds = lt.renderLayout(layout_id= 'student_session_results_search',
+                      schema_id= 'student_returning',
+                      context=context,
+                      mapping=validate and REQUEST,
+                      ob=default,
+                      layout_mode='edit',
+                      formaction = "set_access_data",
+                      button = "Search",
+                      matric_no = matric_no,
+                      commit = False,
+                      )
+if psm == 'invalid':
+    return context.set_access_data_form(rendered = res,
+                                 psm = "Please correct your input!",
+                                 #psm = "%s, %s" % (psm,ds),
+                                 firstlayout = True,
+                                 lastlayout = True,
+                                 ds = ds,
+                                 )
+elif psm == '':
+    return context.set_access_data_form(rendered = res,
+                                 psm = None,
+                                 firstlayout = True,
+                                 lastlayout = True,
+                                 ds = ds,
+                                 )
+elif psm == 'valid':
+    pass
+    #jamb_reg_no = ds.get('jamb_reg_no')
+    #r = context.returning_import(matric_no = matric_no)
+    #if 0 and r and r[0].Entryregno != jamb_reg_no or not r:
+    #    psm = "Your Jamb Registration Nr is wrong"
+    #    return context.set_access_data_form(rendered = res,
+    #                             psm = psm,
+    #                             firstlayout = True,
+    #                             lastlayout = True,
+    #                             ds = ds,
+    #                             )
+from Products.zdb import set_trace;set_trace()
+password = REQUEST.get('widget__password')
+email = ds.get('email')
+st_res = context.students_catalog(matric_no = matric_no)
+if st_res:
+    sid = st_res[0].id
+context.waeup_tool.makeStudentMember(sid,password=password)
+args = {}
+args['__ac_name'] = sid
+args['__ac_password'] = password
+args['returning'] = '1'
+args['email'] = email
+from urllib import urlencode
+url = "%s/logged_in?%s" % (context.absolute_url(),urlencode(args))
+return REQUEST.RESPONSE.redirect(url)
Index: WAeUP_SRP/trunk/skins/waeup_student/set_access_data_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/set_access_data_form.pt	(revision 1151)
+++ WAeUP_SRP/trunk/skins/waeup_student/set_access_data_form.pt	(revision 1151)
@@ -0,0 +1,23 @@
+<tal:block define="rendered_main options/rendered;
+           portal_status_message options/psm;
+           data_storage options/ds;
+           edition python:1;"
+           >
+  <metal:block define-macro="edit_form">
+    <metal:block use-macro="here/content_lib_master/macros/master">
+      <metal:block fill-slot="header"
+                   tal:define="creation creation|nothing;
+                   edition edition|nothing;
+                   metadata metadata|nothing"
+                   >
+      </metal:block>
+      <metal:block fill-slot="main">
+        <h3>Enter Your Email and choose a Password</h3>
+        <br />
+        <div tal:replace="structure rendered_main" />
+      </metal:block>
+      <metal:block fill-slot="sub">
+      </metal:block>
+    </metal:block>
+  </metal:block>
+</tal:block>
