Changeset 60 for waeup_product/trunk
- Timestamp:
- 20 Oct 2005, 07:06:21 (19 years ago)
- Location:
- waeup_product/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/Extensions/install.py
r57 r60 1 #-*- mode: python; mode: fold -*- 1 2 from Products.CPSInstaller.CPSInstaller import CPSInstaller 2 3 from Products.CMFCore.CMFCorePermissions import View, ModifyPortalContent … … 12 13 CPSForum = False 13 14 15 from Products.WAeUP.Students import addStudentsFolder 16 14 17 class WAeUPInstaller(CPSInstaller): 15 18 """ … … 25 28 26 29 ########################################## 27 # Actions 30 # Actions ###( 28 31 ########################################## 29 32 if CPSSubscriptions: … … 152 155 self.verifyActions(actions) 153 156 ########################################## 154 # skins 157 ###) 158 159 # skins 155 160 ########################################## 156 161 self.log("Verifying %(product_name)s skinss" % vars()) … … 186 191 self.log("Verifying %(product_name)s vocabularies" % vars()) 187 192 self.verifyVocabularies(portal.getWAeUPVocabularies()) 188 193 ########################################## 194 # Groups 195 ########################################## 196 189 197 self.installCustomWorkflows() 190 198 self.verifyWorkflowAssociation() … … 230 238 installer = WAeUPInstaller(self) 231 239 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',)) 232 264 return installer.logResult() -
waeup_product/trunk/Students.py
r57 r60 19 19 security = ClassSecurityInfo() 20 20 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 CPSMembershipTool28 ## """29 ##30 ## def getId(self):31 ## """Return the ID of the user."""32 ## return self.getUserName()33 print type_name34 print datamodel35 return self.REQUEST.RESPONSE.redirect("%s" % self.absolute_url())36 mtool = getToolByName(self, 'portal_membership')37 username = "%s" % datamodel.get('reg_nr')38 print username39 member=mtool.getMemberById("S%s" % username)40 print member41 from AccessControl.SecurityManagement import newSecurityManager42 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 ob50 21 51 22 InitializeClass(StudentsFolder) -
waeup_product/trunk/skins/waeup_default/portlet_session_info.pt
r49 r60 8 8 tal:content="member" /><br /> 9 9 <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> 11 11 </span><br /> 12 12 (<a href="" i18n:translate="" … … 15 15 <tal:block condition="anonymous"> 16 16 <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> 18 18 </tal:block> 19 19 <br />
Note: See TracChangeset for help on using the changeset viewer.