Index: WAeUP_SRP/trunk/skins/waeup_academics/academics_contents.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_academics/academics_contents.pt	(revision 998)
+++ WAeUP_SRP/trunk/skins/waeup_academics/academics_contents.pt	(revision 999)
@@ -53,5 +53,5 @@
 
 <!-- a content_lib macro -->
-<!-- $Id$ -->
+<!-- from content_lib_display_contents_column.pt academics_contents.pt -->
 
 <!-- List contents in 'items' in the specified number of columns
@@ -59,5 +59,6 @@
 
 <tal:block
-  define="tmp_format format|nothing;
+  define="no_ajax not:nothing; 
+          tmp_format format|nothing;
           tmp_sort_by sort_by|nothing;
           tmp_direction direction|nothing;
@@ -118,4 +119,5 @@
       <td align="left" valign="top">
        <tal:block define="no_form not:nothing;
+                          no_ajax no_ajax|nothing;
          info python:here.getContentInfo(item, level=1, cpsmcat=cpsmcat);">
          <metal:block use-macro="here/content_lib_info_summary/macros/info_summary" />
@@ -133,5 +135,5 @@
         <tal:block condition="batch_items">
 <!-- a content_lib macro -->
-<!-- $Id$ -->
+<!-- from content_lib_info_detail_tab.pt -->
 
 <!-- Final display of items in a column using the given format -->
@@ -150,5 +152,5 @@
                                      ('Manager', 'WorkspaceManager'), here);
 ">
-  <div id="ajax_psm" style="display:none" tal:condition="python:not no_form">
+  <div id="ajax_psm" style="display:none" tal:condition="python:not no_form and not no_ajax">
       ajax feedback
   </div>
@@ -170,5 +172,5 @@
   XXX Deactivated for CPS 3.4.0, will be re-enabled for 3.4.1
 
-  <tal:block tal:condition="python:not no_form and sort_by is None"
+  <tal:block tal:condition="python:not no_form and not no_ajax and sort_by is None"
                tal:define="ajax_working_msg python:cpsmcat('ajax_working');
                            ajax_working_msg python:ajax_working_msg.replace('\'', '\\\'');
Index: WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py	(revision 998)
+++ WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py	(revision 999)
@@ -45,70 +45,60 @@
 member = mtool.getAuthenticatedMember()
 
-if True or not redirect_url or redirect_url.endswith('/logged_out'):
-    if not is_anon:
-        if "Student" in member.getRoles():
-            to_waeup_student_home = True
-            #info = context.getStudentInfo()
-            #student = info['student']
-            students = context.portal_url.getPortalObject().campus.students
-            student = getattr(students,str(member))
-            student_app = getattr(student,'application')
-            student_pume = getattr(student,'pume',None)
-            s_review_state = wftool.getInfoFor(student,'review_state',None)
-            a_review_state = wftool.getInfoFor(student_app,'review_state',None)
-            #if info['review_state'] in ("student_created","admitted") and\
-            #wftool.getInfoFor(info['app'],'review_state',None) == 'created' :
-            if s_review_state in ("student_created","admitted") and\
-            a_review_state == 'created' :
-                #student.content_status_modify(workflow_action="enter_clearance_pin")
-                #wftool.doActionFor(info['app'],'open')
-                wftool.doActionFor(student_app,'open')
-                #wftool.doActionFor(info['pume'],'close')
-                #if info['pume'] is not None:
-                if student_pume is not None:
-                  #wftool.doActionFor(info['pume'],'close')
-                  wftool.doActionFor(student_pume,'close')
+if not is_anon:
+    if "Student" in member.getRoles():
+        to_waeup_student_home = True
+        students = context.portal_url.getPortalObject().campus.students
+        student = getattr(students,str(member))
+        student_app = getattr(student,'application')
+        student_pume = getattr(student,'pume',None)
+        s_review_state = wftool.getInfoFor(student,'review_state',None)
+        a_review_state = wftool.getInfoFor(student_app,'review_state',None)
+        app_doc = student_app.getContent()
+        #from Products.zdb import set_trace
+        #set_trace()
+        if s_review_state in ("student_created","admitted") and\
+        a_review_state == 'created' :
+            wftool.doActionFor(student_app,'open')
+            if student_pume is not None:
+              wftool.doActionFor(student_pume,'close')
+            da = {}
+            pin = request.get('pin')
+            if not pin:
+                jamb_reg_no = app_doc.jamb_reg_no
+                for reg_no in (jamb_reg_no,jamb_reg_no.lower(),jamb_reg_no.upper()):
+                    res = context.portal_pins(student=reg_no)
+                    if len(res) > 0:
+                        break
+                if len(res) > 0:
+                    p = res[0].pin
+                    if len(p) > 10:
+                        pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:])
+                    else:
+                        pin = p
+            da['app_ac_pin'] = pin
+            da['app_ac_date'] = current
+            app_doc.edit(mapping = da)
+        elif s_review_state in ("admitted") and a_review_state == 'opened' and\
+        not app_doc.app_ac_pin:
+            jamb_reg_no = app_doc.jamb_reg_no
+            for reg_no in (jamb_reg_no,jamb_reg_no.lower(),jamb_reg_no.upper()):
+                res = context.portal_pins(student=reg_no)
+                if len(res) > 0:
+                    break
+            if len(res) > 0:
+                p = res[0].pin
+                if len(p) > 10:
+                    pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:])
+                else:
+                    pin = p
                 da = {}
-                pin = request.get('pin')
-                app_doc = student_app.getContent()
-                if not pin:
-                    app_doc = student_app.getContent()
-                    jamb_reg_no = app_doc.jamb_reg_no
-                    res = context.portal_pins(student=jamb_reg_no)
-                    if len(res) == 1:
-                        p = res[0].pin
-                        if len(p) > 10:
-                            pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:])
-                        else:
-                            pin = p
-##                email = request.get('email')
-                #app_doc = info['app_doc']
                 da['app_ac_pin'] = pin
-##                da['app_email'] = email
-                da['app_ac_date'] = current
                 app_doc.edit(mapping = da)
-##                dc = {}
-##                dc['clr_ac_pin'] = pin
-##                dc['entry_date'] = current
-##                dc['session'] = "%s" % current.year()
-##                dc['lga'] = app_doc.jamb_lga
-##                info['clear_doc'].edit(mapping = dc)
-        elif "Manager" in member.getRoles():
-            pass
-        else:
-            to_member_home, to_workspaces = checkRedirect(portal, mtool)
-    if (not to_member_home) and (not to_workspaces):
-        redirect_to_portal = True
-else:
-    redirect_url = unquote(redirect_url)
-    # One can be redirected from an http page while the login is done from an
-    # https page. This is a fix for #1205.
-    # A better option here would be to replace the previous portal_absolute_url
-    # prefix in the redirect_url by the current portal absolute URL.
-    if not redirect_url.startswith(portal_absolute_url):
-        if not is_anon:
-            to_member_home, to_workspaces = checkRedirect(portal, mtool)
-        if (not to_member_home) and (not to_workspaces):
-            redirect_to_portal = True
+    elif "Manager" in member.getRoles():
+        pass
+    else:
+        to_member_home, to_workspaces = checkRedirect(portal, mtool)
+if (not to_member_home) and (not to_workspaces):
+    redirect_to_portal = True
 
 if to_waeup_student_home:
Index: WAeUP_SRP/trunk/skins/waeup_pins/batch_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_pins/batch_view.pt	(revision 998)
+++ WAeUP_SRP/trunk/skins/waeup_pins/batch_view.pt	(revision 999)
@@ -26,5 +26,5 @@
         <br />
         
-        <span tal:condition="python:member.id in ('admin','perry')">        
+        <span tal:condition="python:member.id in ('admin','joachim')">        
         <h3>Unused</h3>
         <table>
Index: WAeUP_SRP/trunk/skins/waeup_student/check_admission.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/check_admission.py	(revision 998)
+++ WAeUP_SRP/trunk/skins/waeup_student/check_admission.py	(revision 999)
@@ -48,4 +48,22 @@
 elif psm == 'valid':
     s_id = ds.get('s_id')
+<<<<<<< .mine
+    if is_anon and not s_id:
+        return context.check_admission_pin_form(rendered = res,
+                                 psm = "You are not allowed to do this in this context",
+                                 #psm = "%s, %s" % (psm,ds),
+                                 firstlayout = True,
+                                 lastlayout = True,
+                                 ds = ds,
+                                 )
+    elif not is_anon:
+        return context.check_admission_pin_form(rendered = res,
+                                 psm = "You are logged in",
+                                 #psm = "%s, %s" % (psm,ds),
+                                 firstlayout = True,
+                                 lastlayout = True,
+                                 ds = ds,
+                                 )
+=======
     if is_anon and not s_id:
         return context.check_admission_pin_form(rendered = res,
@@ -64,4 +82,5 @@
                                  ds = ds,
                                  )
+>>>>>>> .r998
 ##  
 ##    email = ds.get('app_email')
Index: WAeUP_SRP/trunk/skins/waeup_student/search_students.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/search_students.py	(revision 998)
+++ WAeUP_SRP/trunk/skins/waeup_student/search_students.py	(revision 999)
@@ -50,5 +50,5 @@
 validate = request.has_key("cpsdocument_edit_button")
 default = {'search_mode': 'name',
-        'review_state': 'clearance_requested',
+        'review_state': 'all',
         'search_string': ''
         }
Index: WAeUP_SRP/trunk/skins/waeup_student/student_index.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/student_index.py	(revision 998)
+++ WAeUP_SRP/trunk/skins/waeup_student/student_index.py	(revision 999)
@@ -16,4 +16,5 @@
 redirect = request.RESPONSE.redirect
 pm = context.portal_membership
+member = pm.getAuthenticatedMember()
 
 if context.isStaff():
@@ -25,9 +26,9 @@
         return context.clearance_view()
     elif context.portal_type == 'Student':
-    	return redirect("%s/student_view" % context.absolute_url())
+        return redirect("%s/student_view" % context.absolute_url())
     return redirect("%s/waeup_document_view" % context.absolute_url())
 if context.isStudent():
-    info = context.getStudentInfo()
-    student = info['student']
+    students = context.portal_url.getPortalObject().campus.students
+    student = getattr(students,str(member))
     return redirect("%s/student_view" % student.absolute_url())
 
