Changeset 60


Ignore:
Timestamp:
20 Oct 2005, 07:06:21 (19 years ago)
Author:
joachim
Message:

=install set everything up

Location:
waeup_product/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • waeup_product/trunk/Extensions/install.py

    r57 r60  
     1#-*- mode: python; mode: fold -*-
    12from Products.CPSInstaller.CPSInstaller import CPSInstaller
    23from Products.CMFCore.CMFCorePermissions import View, ModifyPortalContent
     
    1213  CPSForum = False
    1314
     15from Products.WAeUP.Students import addStudentsFolder
     16
    1417class WAeUPInstaller(CPSInstaller):
    1518    """
     
    2528   
    2629        ##########################################
    27         # Actions
     30        # Actions ###(
    2831        ##########################################
    2932        if CPSSubscriptions:
     
    152155        self.verifyActions(actions)
    153156        ##########################################
    154         # skins
     157###)
     158
     159        # skins
    155160        ##########################################
    156161        self.log("Verifying %(product_name)s skinss" % vars())
     
    186191        self.log("Verifying %(product_name)s vocabularies" % vars())
    187192        self.verifyVocabularies(portal.getWAeUPVocabularies())
    188    
     193        ##########################################
     194        # Groups
     195        ##########################################
     196           
    189197        self.installCustomWorkflows()
    190198        self.verifyWorkflowAssociation()
     
    230238    installer = WAeUPInstaller(self)
    231239    installer.install(self)
     240    dirtool = getattr(self,'portal_directories')
     241    groups = dirtool.groups
     242    for newEntry in ('Students','StudentManager'):
     243        if newEntry not in groups.listEntryIds():
     244            groups.createEntry({'group': newEntry,
     245                                'members': []}) 
     246    groups.manage_setLocalGroupRoles(groupid = 'StudentManager',roles=('Manager',))
     247    #groups.manage_setLocalGroupRoles(groupid = 'Students',roles=('Contributor',))
     248    sections = getattr(self,'sections')
     249    waeup = getattr(sections,'waeup',None)
     250    if not waeup:
     251        sections.content_create(type_name='University',title='waeup')
     252        sections.waeup.folder_localrole_add(member_ids=('group:Students',),
     253                                            member_role='SectionReviewer',
     254                                            )
     255        sections.waeup.content_create(type_name='StudentsFolder',title='students')
     256        sections.waeup.folder_localrole_add(member_ids=('group:Students',),
     257                                            member_role='SectionReviewer',
     258                                            )
     259        sections.waeup.folder_localrole_add(member_ids=('group:StudentManager',),
     260                                            member_role='SectionManager',
     261                                            )
     262        sections.waeup.students.manage_setLocalGroupRoles(groupid = 'role:Anonymous',roles=('SectionReader',))
     263        sections.waeup.students.manage_setLocalGroupRoles(groupid = 'Students',roles=('Contributor',))
    232264    return installer.logResult()
  • waeup_product/trunk/Students.py

    r57 r60  
    1919    security = ClassSecurityInfo()
    2020   
    21     security.declarePublic("doCheckAdmission")
    22     def doCheckAdmission(self,type_name,datamodel):
    23         "the admission callback"
    24 ##        class CPSUnrestrictedUser(UnrestrictedUser):
    25 ##            """Unrestricted user that still has an id.
    26 ##
    27 ##            Taken from CPSMembershipTool
    28 ##            """
    29 ##
    30 ##            def getId(self):
    31 ##                """Return the ID of the user."""
    32 ##                return self.getUserName()
    33         print type_name
    34         print datamodel
    35         return self.REQUEST.RESPONSE.redirect("%s" % self.absolute_url())
    36         mtool = getToolByName(self, 'portal_membership')
    37         username = "%s" % datamodel.get('reg_nr')
    38         print username
    39         member=mtool.getMemberById("S%s" % username)
    40         print member
    41         from AccessControl.SecurityManagement import newSecurityManager
    42         newSecurityManager(None,member.__of__(mtool.acl_users))
    43         # datamodel is passed so that flexti can initialize the object.
    44         #datamodel.set('lastname','Meier')
    45         student = getattr(self,username)
    46         student.invokeFactory('StudentPersonal', '%s' % username)
    47         ob = getattr(student, id)
    48         ##context.notifyCPSDocumentCreation(ob=ob)
    49         return ob
    5021       
    5122InitializeClass(StudentsFolder)
  • waeup_product/trunk/skins/waeup_default/portlet_session_info.pt

    r49 r60  
    88          tal:content="member" /><br />
    99      <a href="" tal:condition="python: 'Students' in member.getGroups()"
    10          tal:attributes="href string:${here/portal_url}/sections/unidemo/students/${member}">goto your personal area</a>
     10         tal:attributes="href string:${here/portal_url}/sections/waeup/students/${member}">goto your personal area</a>
    1111    </span><br />
    1212    (<a href="" i18n:translate=""
     
    1515  <tal:block condition="anonymous">
    1616    <span >You are currently not logged in </span><br />
    17     <a href="" tal:attributes="href string:${here/portal_url}/sections/unidemo/students/check_admission">check your admission status</a>
     17    <a href="" tal:attributes="href string:${here/portal_url}/sections/waeup/students/check_admission">check your admission status</a>
    1818  </tal:block>
    1919  <br />
Note: See TracChangeset for help on using the changeset viewer.