Index: /WAeUP_SRP/trunk/PatchCPSUserFolderUserFolder.py
===================================================================
--- /WAeUP_SRP/trunk/PatchCPSUserFolderUserFolder.py	(revision 1956)
+++ /WAeUP_SRP/trunk/PatchCPSUserFolderUserFolder.py	(revision 1957)
@@ -3,5 +3,5 @@
 from Acquisition import Implicit
 from Acquisition import aq_base, aq_parent, aq_inner
-
+import re
 security = ClassSecurityInfo()
 
@@ -70,6 +70,20 @@
             roles.append(r)
     ## patch to assign dynamic roles for WAeUP
-    while 1:
-        if self.isStudent():
+    while 1:        
+        #if self.isStudent():
+        #    break
+        # if re.match(r'\D\d\d\d\d\d\d',name):
+        #    break
+        #if len(name) != 7:
+        #    break
+        #try:
+        #    int(name[1:])
+        #except:
+        #    break
+        for c in name:
+            is_student = True
+            if c not in ('0123456789'):
+                is_student = False
+        if is_student and len(name) == 7:
             break
         groups = self.portal_membership.getAuthenticatedMember().getGroups()
Index: /WAeUP_SRP/trunk/skins/waeup_default/isCourseAdviser.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/isCourseAdviser.py	(revision 1956)
+++ /WAeUP_SRP/trunk/skins/waeup_default/isCourseAdviser.py	(revision 1957)
@@ -9,8 +9,16 @@
 ##
 # $Id: isClearanceOfficer.py 1087 2006-12-18 22:13:31Z joachim $
-if context.isStudent():
+member = context.portal_membership.getAuthenticatedMember()
+member_id = str(member)
+for c in member_id:
+    is_student = True
+    if c not in ('0123456789'):
+        is_student = False
+        break
+if is_student and len(member_id) == 7:
     return False
-mtool = context.portal_membership
-roles = mtool.getAuthenticatedMember().getRolesInContext(context)
+# if context.isStudent():
+#     return False
+roles = member.getRolesInContext(context)
 return "CourseAdviser" in roles
 
Index: /WAeUP_SRP/trunk/skins/waeup_default/isSectionOfficer.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/isSectionOfficer.py	(revision 1956)
+++ /WAeUP_SRP/trunk/skins/waeup_default/isSectionOfficer.py	(revision 1957)
@@ -10,8 +10,16 @@
 # $Id: isManager.py 888 2006-11-17 21:28:48Z henrik $
 
-if context.isStudent():
+member = context.portal_membership.getAuthenticatedMember()
+member_id = str(member)
+for c in member_id:
+    is_student = True
+    if c not in ('0123456789'):
+        is_student = False
+        break
+if is_student and len(member_id) == 7:
     return False
-mtool = context.portal_membership
-roles = mtool.getAuthenticatedMember().getRolesInContext(context)
+# if context.isStudent():
+#     return False
+roles = member.getRolesInContext(context)
 return "SectionOfficer" in roles or\
        "SectionManager" in roles or\
Index: /WAeUP_SRP/trunk/skins/waeup_default/isStaff.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/isStaff.py	(revision 1956)
+++ /WAeUP_SRP/trunk/skins/waeup_default/isStaff.py	(revision 1957)
@@ -10,17 +10,15 @@
 # $Id: $
 
-if context.portal_membership.isAnonymousUser():
-    return False
-return not context.isStudent()
+# if context.portal_membership.isAnonymousUser():
+#     return False
+# return not context.isStudent()
 
 mtool = context.portal_membership
 member = mtool.getAuthenticatedMember()
-roles = member.getRolesInContext(context)
-
-return "Manager" in roles or\
-       "SectionManager" in roles or\
-       "SectionOfficer" in roles or\
-       "ClearanceOfficer" in roles or\
-       "CourseAdviser" in roles or\
-       "CourseAdvisers" in member.getGroups() or\
-       "ClearanceOfficers" in member.getGroups()
+member_id = str(member)
+for c in member_id:
+    is_student = True
+    if c not in ('0123456789'):
+        is_student = False
+        break
+return not (is_student and len(member_id) == 7)
Index: /WAeUP_SRP/trunk/skins/waeup_default/isStudent.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/isStudent.py	(revision 1956)
+++ /WAeUP_SRP/trunk/skins/waeup_default/isStudent.py	(revision 1957)
@@ -11,9 +11,16 @@
 
 member_id = str(context.portal_membership.getAuthenticatedMember())
-if len(member_id) != 7:
-    return False
-try:
-    int(member_id[1:])
-    return True
-except:
-    return False
+#from Products.zdb import set_trace;set_trace()
+# if len(member_id) != 7:
+#     return False
+# try:
+#     int(member_id[1:])
+#     return True
+# except:
+#     return False
+for c in member_id:
+    is_student = True
+    if c not in ('0123456789'):
+        is_student = False
+        break
+return is_student and len(member_id) == 7
