Changeset 7172 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 22 Nov 2011, 17:39:35 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 10 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/app.py
r7170 r7172 10 10 from waeup.sirp.interfaces import ( 11 11 IUniversity, IWAeUPSIRPPluggable, IObjectUpgradeEvent, ) 12 from waeup.sirp.user container import UserContainer12 from waeup.sirp.userscontainer import UsersContainer 13 13 from waeup.sirp.utils.logger import Logger 14 14 from waeup.sirp.utils.helpers import attrs_to_fields … … 37 37 the like. 38 38 """ 39 self['users'] = User Container()39 self['users'] = UsersContainer() 40 40 self['datacenter'] = DataCenter() 41 41 self['students'] = StudentsContainer() -
main/waeup.sirp/trunk/src/waeup/sirp/app.txt
r7170 r7172 65 65 66 66 >>> myuniversity['users'] 67 <waeup.sirp.user container.UserContainer object at 0x...>67 <waeup.sirp.userscontainer.UsersContainer object at 0x...> 68 68 69 69 >>> myuniversity['datacenter'] -
main/waeup.sirp/trunk/src/waeup/sirp/authentication.py
r7169 r7172 153 153 def getAccount(self, login): 154 154 # ... look up the account object and return it ... 155 user container = self.getUserContainer()156 if user container is None:155 userscontainer = self.getUsersContainer() 156 if userscontainer is None: 157 157 return 158 return user container.get(login, None)158 return userscontainer.get(login, None) 159 159 160 160 def addAccount(self, account): 161 user container = self.getUserContainer()162 if user container is None:161 userscontainer = self.getUsersContainer() 162 if userscontainer is None: 163 163 return 164 164 # XXX: complain if name already exists... 165 user container.addAccount(account)165 userscontainer.addAccount(account) 166 166 167 167 def addUser(self, name, password, title=None, description=None): 168 user container = self.getUserContainer()169 if user container is None:168 userscontainer = self.getUsersContainer() 169 if userscontainer is None: 170 170 return 171 user container.addUser(name, password, title, description)172 173 def getUser Container(self):171 userscontainer.addUser(name, password, title, description) 172 173 def getUsersContainer(self): 174 174 site = grok.getSite() 175 175 return site['users'] -
main/waeup.sirp/trunk/src/waeup/sirp/authentication.txt
r7169 r7172 40 40 >>> root['app']['users'].addAccount(alice) 41 41 42 See ``users.txt`` for details about the User Container we use here.42 See ``users.txt`` for details about the UsersContainer we use here. 43 43 44 44 Users and local roles -
main/waeup.sirp/trunk/src/waeup/sirp/browser/breadcrumbs.py
r7137 r7172 124 124 return 'Session %s' % session_string 125 125 126 class User ContainerBreadcrumb(Breadcrumb):126 class UsersContainerBreadcrumb(Breadcrumb): 127 127 """A breadcrumb for user containers. 128 128 """ 129 grok.context(interfaces.IUser Container)129 grok.context(interfaces.IUsersContainer) 130 130 title = u'Portal Users' 131 131 parent_viewname = 'administration' -
main/waeup.sirp/trunk/src/waeup/sirp/browser/breadcrumbs.txt
r6734 r7172 120 120 [<...breadcrumbs.UniversityBreadcrumb object at 0x...>, 121 121 <...breadcrumbs.AdministrationBreadcrumb object at 0x...>, 122 <...breadcrumbs.User ContainerBreadcrumb object at 0x...>]122 <...breadcrumbs.UsersContainerBreadcrumb object at 0x...>] 123 123 124 124 -
main/waeup.sirp/trunk/src/waeup/sirp/browser/interfaces.py
r7137 r7172 4 4 from zope.interface import Interface, Attribute 5 5 from waeup.sirp.interfaces import ( 6 IWAeUPObject, IUniversity, IUser Container, IDataCenter)6 IWAeUPObject, IUniversity, IUsersContainer, IDataCenter) 7 7 from waeup.sirp.university.interfaces import ( 8 8 IFacultyContainer, IFaculty, IFacultyAdd, IDepartment, IDepartmentAdd, -
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r7169 r7172 32 32 from waeup.sirp.browser.resources import warning, datepicker, tabs, datatable 33 33 from waeup.sirp.interfaces import( 34 IWAeUPObject, IUser Container, IUserAccount, IDataCenter,34 IWAeUPObject, IUsersContainer, IUserAccount, IDataCenter, 35 35 IWAeUPXMLImporter, IWAeUPXMLExporter, IBatchProcessor, 36 36 ILocalRolesAssignable, DuplicationError, IConfigurationContainer, … … 245 245 # 246 246 247 class User ContainerPage(WAeUPPage):247 class UsersContainerPage(WAeUPPage): 248 248 """Overview page for all local users. 249 249 """ 250 250 grok.require('waeup.manageUsers') 251 grok.context(IUser Container)251 grok.context(IUsersContainer) 252 252 grok.name('index') 253 253 title = 'Portal Users' … … 262 262 class AddUserFormPage(WAeUPAddFormPage): 263 263 grok.require('waeup.manageUsers') 264 grok.context(IUser Container)264 grok.context(IUsersContainer) 265 265 grok.name('add') 266 266 grok.template('usereditformpage') -
main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py
r7167 r7172 10 10 from waeup.sirp.browser.pages import ( 11 11 UniversityPage, FacultyContainerPage, DatacenterPage, FacultyPage, 12 DepartmentPage, CoursePage, CertificatePage, CertificateCoursePage, User ContainerPage)12 DepartmentPage, CoursePage, CertificatePage, CertificateCoursePage, UsersContainerPage) 13 13 from waeup.sirp.browser.interfaces import ( 14 14 IFacultyContainer, IFaculty, IDepartment, ICourse, ICertificate, 15 ICertificateCourse, IBreadcrumbContainer, IUniversity, IUser Container)15 ICertificateCourse, IBreadcrumbContainer, IUniversity, IUsersContainer) 16 16 from waeup.sirp.interfaces import (IWAeUPObject, IWAeUPXMLExporter, 17 17 IWAeUPXMLImporter, IDataCenter) … … 422 422 class AddUserActionButton(AddActionButton): 423 423 grok.require('waeup.manageUsers') 424 grok.context(IUser Container)425 grok.view(User ContainerPage)424 grok.context(IUsersContainer) 425 grok.view(UsersContainerPage) 426 426 text = 'Add user' 427 427 -
main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py
r7149 r7172 202 202 203 203 204 class IUser Container(IWAeUPObject):204 class IUsersContainer(IWAeUPObject): 205 205 """A container for users (principals). 206 206 -
main/waeup.sirp/trunk/src/waeup/sirp/userscontainer.py
r7170 r7172 1 """User container for the WAeUP portal.1 """Users container for the WAeUP portal. 2 2 """ 3 3 import grok 4 4 from zope.event import notify 5 5 from waeup.sirp.authentication import Account 6 from waeup.sirp.interfaces import IUser Container6 from waeup.sirp.interfaces import IUsersContainer 7 7 8 class User Container(grok.Container):8 class UsersContainer(grok.Container): 9 9 """A container for principals. 10 10 11 11 See interfaces.py and users.txt for extensive description. 12 12 """ 13 grok.implements(IUser Container)13 grok.implements(IUsersContainer) 14 14 grok.require('waeup.manageUsers') 15 15 -
main/waeup.sirp/trunk/src/waeup/sirp/userscontainer.txt
r7170 r7172 14 14 us: 15 15 16 >>> from waeup.sirp.user container import UserContainer17 >>> myusers = User Container()16 >>> from waeup.sirp.userscontainer import UsersContainer 17 >>> myusers = UsersContainer() 18 18 19 19 We can add users, just by passing a name, a password, and (optionally)
Note: See TracChangeset for help on using the changeset viewer.