Changeset 1077 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
18 Dec 2006, 19:44:57 (18 years ago)
Author:
joachim
Message:

files for custom

Location:
WAeUP_SRP/trunk/skins
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_default/isSectionOfficer.py

    r911 r1077  
    1010# $Id: isManager.py 888 2006-11-17 21:28:48Z henrik $
    1111
     12if context.isStudent():
     13    return False
    1214mtool = context.portal_membership
    1315roles = mtool.getAuthenticatedMember().getRolesInContext(context)
    14 return "SectionManager" in roles or\
    15        "Manager" in roles or\
    16        "SectionOfficer" in roles
     16return "SectionOfficer" in roles or\
     17       "SectionManager" in roles or\
     18       "Manager" in roles
     19       
  • WAeUP_SRP/trunk/skins/waeup_default/isStaff.py

    r911 r1077  
    1010# $Id: $
    1111
     12if context.portal_membership.isAnonymousUser():
     13    return False
     14return not context.isStudent()
     15
    1216mtool = context.portal_membership
    1317member = mtool.getAuthenticatedMember()
  • WAeUP_SRP/trunk/skins/waeup_default/isStudent.py

    r1042 r1077  
    1010# $Id$
    1111
    12 #session = context.REQUEST.SESSION
    13 #roles = member.getRolesInContext(context)
    14 #return  "Student" in roles
    15 
    16 mtool = context.portal_membership
    17 member = mtool.getAuthenticatedMember()
    18 member_id = str(member)
    19 if len(member_id) == 7:
    20     try:
    21         int(member_id[1:])
    22         return True
    23     except:
    24         return False
     12member_id = str(context.portal_membership.getAuthenticatedMember())
     13if len(member_id) != 7:
     14    return False
     15try:
     16    int(member_id[1:])
     17    return True
     18except:
     19    return False
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentName.py

    r1071 r1077  
    1212return Info about the current Student
    1313"""
    14 import logging
    15 logger = logging.getLogger('getApplicationInfo')
    16 
    17 request = context.REQUEST
    1814mtool = context.portal_membership
    19 wf = context.portal_workflow
    2015member = mtool.getAuthenticatedMember()
    21 member_id = str(member)
    22 path_info = request.get('PATH_INFO').split('/')
    23 
    2416if mtool.isAnonymousUser():
    2517    return None
    26 
    2718info = {}
    2819#from Products.zdb import set_trace
    2920#set_trace()
    30 student_id = context.getStudentId()
    31 if not student_id:
     21if context.isStaff():
     22    return member.getProperty('fullname',None)
     23if not context.isStudent():
    3224    return None
    33 res = context.students_catalog(id = student_id)
     25res = context.students_catalog(id = str(member))
    3426if len(res) != 1:
    3527    return None
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentWorkflowInfo.py

    r1072 r1077  
    1212return Info about the current Student
    1313"""
    14 import logging
    15 logger = logging.getLogger('getApplicationInfo')
    16 
    17 request = context.REQUEST
    1814mtool = context.portal_membership
    1915wf = context.portal_workflow
    2016member = mtool.getAuthenticatedMember()
    2117member_id = str(member)
    22 path_info = request.get('PATH_INFO').split('/')
    23 
    2418if mtool.isAnonymousUser():
    2519    return None
    2620info = {}
    27 #from Products.zdb import set_trace
    28 #set_trace()
    29 requested_id = context.getStudentId()
    30 if member_id != requested_id:
    31     logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
     21if not context.isStudent():
    3222    return None
    3323student_id = member_id
    34 
    35 
    3624students_object = context.portal_url.getPortalObject().campus.students
    3725student = getattr(students_object, student_id)
  • WAeUP_SRP/trunk/skins/waeup_student/raise_objection.py

    r1001 r1077  
    1313"""
    1414import DateTime
     15import logging
     16logger = logging.getLogger('raise_objection')
     17
     18wf = context.portal_workflow
     19info = context.getStudentInfo()
     20if not info:
     21    logger.info('"%s", "tried to access", "%s"' % (context.portal_membership.getAuthenticatedMember(),requested_id))
     22    return context.admission_form()
    1523current = DateTime.DateTime()
    16 request = context.REQUEST
    17 wf = context.portal_workflow
    18 mtool = context.portal_membership
    19 member = mtool.getAuthenticatedMember()
    20 roles = member.getRoles()
    21 
    22 info = context.getStudentInfo()
    23 
    2424info['app_doc'].edit(mapping={'objection_date':current,})
    2525if info['review_state'] == "admitted":
Note: See TracChangeset for help on using the changeset viewer.