Index: /WAeUP_SRP/trunk/PatchBasicWidgetsUnprepare.py
===================================================================
--- /WAeUP_SRP/trunk/PatchBasicWidgetsUnprepare.py	(revision 1070)
+++ /WAeUP_SRP/trunk/PatchBasicWidgetsUnprepare.py	(revision 1071)
@@ -6,4 +6,4 @@
         # unprepare may be called several times
         pass
-from Products.CPSSchemas import BasicWidgets
-BasicWidgets.unprepare = unprepare
+from Products.CPSSchemas.BasicWidgets import CPSFileWidget
+CPSFileWidget.unprepare = unprepare
Index: /WAeUP_SRP/trunk/skins/waeup_default/portlet_session_info.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/portlet_session_info.pt	(revision 1070)
+++ /WAeUP_SRP/trunk/skins/waeup_default/portlet_session_info.pt	(revision 1071)
@@ -2,12 +2,12 @@
            member mtool/getAuthenticatedMember;
            isAnon mtool/isAnonymousUser;
-           info context/getStudentInfo;"
+           name context/getStudentName;"
            >
-  <tal:block condition="context/isStudent">
+  <tal:block condition="name">
        <strong> 
-         <span tal:condition="context/isStudent|nothing" tal:content="python:info['student_doc'].Title()" /> 
+         <span tal:content="name" /> 
        </strong>
   </tal:block>
-  <tal:block condition="not:context/isStudent">
+  <tal:block condition="not:name">
        <strong> 
          <span tal:content="python:member.getProperty('fullname',None)" /> 
Index: /WAeUP_SRP/trunk/skins/waeup_student/application_edit.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/application_edit.py	(revision 1070)
+++ /WAeUP_SRP/trunk/skins/waeup_student/application_edit.py	(revision 1071)
@@ -27,5 +27,5 @@
 # Validate the document and write it if it's valid
 # (We don't call getEditableContent here, validate does it when needed.)
-info = context.getStudentInfo()
+info = context.getApplicationInfo()
 
 if info is None:
@@ -36,5 +36,5 @@
 app = info['app']
 app_doc = info['app_doc']
-state = context.getStudentInfo()['review_state']
+state = info['review_state']
 is_valid, ds = app_doc.validate(request=REQUEST,
                                 schema_id = 'student_application',
Index: /WAeUP_SRP/trunk/skins/waeup_student/application_edit_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/application_edit_form.pt	(revision 1070)
+++ /WAeUP_SRP/trunk/skins/waeup_student/application_edit_form.pt	(revision 1071)
@@ -1,3 +1,3 @@
-<metal:html tal:define="info context/getStudentInfo">
+<metal:html tal:define="info context/getApplicationInfo">
   <span tal:condition="not: info">
     <metal:block use-macro="here/illegal_view/macros/illegal_view" />
Index: /WAeUP_SRP/trunk/skins/waeup_student/getApplicationInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/getApplicationInfo.py	(revision 1071)
+++ /WAeUP_SRP/trunk/skins/waeup_student/getApplicationInfo.py	(revision 1071)
@@ -0,0 +1,44 @@
+## Script (Python) "getStudentInfo"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+return Info about the current Student
+"""
+import logging
+logger = logging.getLogger('getApplicationInfo')
+
+request = context.REQUEST
+mtool = context.portal_membership
+wf = context.portal_workflow
+member = mtool.getAuthenticatedMember()
+member_id = str(member)
+path_info = request.get('PATH_INFO').split('/')
+
+if mtool.isAnonymousUser():
+    return None
+info = {}
+#from Products.zdb import set_trace
+#set_trace()
+requested_id = context.getStudentId()
+if member_id != requested_id:
+    logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
+    student_id = member_id
+    mtool.assertViewable(context)
+student_id = member_id
+
+
+students_object = context.portal_url.getPortalObject().campus.students
+student = getattr(students_object, student_id)
+info['id'] = student_id
+info['student'] = student
+info['review_state'] = wf.getInfoFor(student,'review_state',None)
+info['app'] = student.application
+info['app_doc'] = student.application.getContent()
+return info
Index: /WAeUP_SRP/trunk/skins/waeup_student/getStudentId.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/getStudentId.py	(revision 1070)
+++ /WAeUP_SRP/trunk/skins/waeup_student/getStudentId.py	(revision 1071)
@@ -12,4 +12,5 @@
 return StudentId from request
 """
+
 ptl = context.REQUEST.get('PATH_TRANSLATED').split('/')
 try:
@@ -17,5 +18,12 @@
 except:
     return None
-if len(ptl) > id_index + 2:
-    return ptl[id_index + 1]
-return None
+if len(ptl) <= id_index + 1:
+    return None
+student_id = ptl[id_index +1]
+if len(student_id) != 7:
+    return None
+try:
+    int(student_id[1:])
+    return student_id
+except:
+    return None
Index: /WAeUP_SRP/trunk/skins/waeup_student/getStudentName.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/getStudentName.py	(revision 1071)
+++ /WAeUP_SRP/trunk/skins/waeup_student/getStudentName.py	(revision 1071)
@@ -0,0 +1,36 @@
+## Script (Python) "getStudentInfo"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+return Info about the current Student
+"""
+import logging
+logger = logging.getLogger('getApplicationInfo')
+
+request = context.REQUEST
+mtool = context.portal_membership
+wf = context.portal_workflow
+member = mtool.getAuthenticatedMember()
+member_id = str(member)
+path_info = request.get('PATH_INFO').split('/')
+
+if mtool.isAnonymousUser():
+    return None
+
+info = {}
+#from Products.zdb import set_trace
+#set_trace()
+student_id = context.getStudentId()
+if not student_id:
+    return None
+res = context.students_catalog(id = student_id)
+if len(res) != 1:
+    return None
+return res[0].name
Index: /WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt	(revision 1070)
+++ /WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt	(revision 1071)
@@ -8,7 +8,4 @@
   formaction options/formaction|string:application_edit;
   creation creation|nothing;
-  metadata metadata|nothing;
-  type_name request/type_name|nothing;
-  ti python:type_name and getattr(here.portal_types,type_name,None) or getattr(here.portal_types,here.portal_type,None);
   cpsmcat nocall:here/translation_service;
   proceed options/proceed|nothing;
Index: /WAeUP_SRP/trunk/skins/waeup_student/search_students.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/search_students.py	(revision 1070)
+++ /WAeUP_SRP/trunk/skins/waeup_student/search_students.py	(revision 1071)
@@ -72,5 +72,5 @@
         departments = [f.getId for f in res]
     user_info['departments'] = departments
-default = {'search_mode': 'name',
+default = {'search_mode': 'student_id',
         'review_state': state,
         'search_string': ''
@@ -114,11 +114,9 @@
                              allowed = True,
                              )
+st_queries = ('jamb_reg_no','matric_no','name')
+review_res = None
+query = None
 items = []
 res = []
-portal_type_query = {'query':['Student','StudentApplication','StudentPersonal']}
-st_queries = ('jamb_reg_no','matric_no','name')
-query_step = 0
-review_res = None
-query = None
 review_set = []
 search_set = []
@@ -126,5 +124,4 @@
     if what == "student_id":
         students_folder = context.portal_url.getPortalObject().campus.students
-        query_step = 1
         if hasattr(students_folder,term.strip()):
             request.RESPONSE.redirect("%s/%s" % (students_folder.absolute_url(),term))
@@ -139,18 +136,14 @@
     elif what in st_queries:
         if what == "jamb_reg_no":
-            query_step = 2
             pt = ('StudentApplication',)
             st = "%s" % term.strip().lower()
         elif what == "matric_no":
-            query_step = 3
             pt = ('StudentClearance',)
             st = "%s" % term.strip().lower()
         elif what == "name":
-            query_step = 4
             pt = ('StudentPersonal')
             st = "%s" % term.strip()
         query = In('portal_type',pt) & Eq('SearchableText',"%s*" % term.strip())
         res = evalAdvancedQuery(query)
-        search_set = []
         if res:
             for r in res:
@@ -164,11 +157,9 @@
     res = aq_students(query)
     search_set = [r.id for r in res]
-##        res = context.students_catalog(faculty=faculties[0],)
-##        res = context.students_catalog(faculty=faculties,department=departments)
-#set_trace()
-if with_review:
-    query_step += 10
-    #review_res = evalAdvancedQuery(('portal_type',student_objects) & Eq('review_state',state))
-    review_res = evalAdvancedQuery(Eq('review_state',state))
+if with_review and len(search_set) > 0:
+    query = In('id',search_set) & Eq('review_state',state)
+elif with_review:
+    query = Eq('review_state',state)
+    review_res = evalAdvancedQuery(query)
 review_set = []
 if review_res:
@@ -177,18 +168,18 @@
         #review_set.append(pl[pl.index('students') + 1])
         review_set.append(r.getId)
-all = []
+all = review_set
 #set_trace()
-if only_review:
-    all = review_set
-elif with_review:
-    for i in search_set:
-        if i in review_set:
-            all.append(i)
-else:
-    all = search_set
-##for a in all[:50]:
-##    if a in items:
-##        continue
-##    items.append(a)
+##if only_review:
+##    all = review_set
+##elif with_review:
+##    for i in search_set:
+##        if i in review_set:
+##            all.append(i)
+##else:
+##    all = search_set
+####for a in all[:50]:
+####    if a in items:
+####        continue
+####    items.append(a)
 items = all[:500]
 students = []
