Logo Search packages:      
Sourcecode: zope-exuserfolder version File versions

def zope-exuserfolder-0.50.0::exUserFolder::exUserFolder::manage_addUser (   self,
  REQUEST 
)

Add a New User 

Definition at line 675 of file exUserFolder.py.

00675                                        :
            """ Add a New User """
            username=self.reqattr(REQUEST,'username')
            password=self.reqattr(REQUEST,'password')
            password_confirm=self.reqattr(REQUEST,'password_confirm')
            roles=self.reqattr(REQUEST,'roles')
            groups=self.reqattr(REQUEST, 'groupnames', [])

            if not username:
                  return self.MessageDialog(self,REQUEST=REQUEST,
                        title  ='Illegal value', 
                        message='A username must be specified',
                        action ='manage_main')

            if not password or not password_confirm:
                  return self.MessageDialog(self,REQUEST=REQUEST,
                        title  ='Illegal value', 
                        message='Password and confirmation must be specified',
                        action ='manage_main')

            if (self.getUser(username) or
                  (self._emergency_user and
                   username == self._emergency_user.getUserName())):
                  return self.MessageDialog(self,REQUEST=REQUEST,
                        title  ='Illegal value', 
                        message='A user with the specified name already exists',
                        action ='manage_main')

            if (password or password_confirm) and (password != password_confirm):
                  return self.MessageDialog(self,REQUEST=REQUEST,
                        title  ='Illegal value', 
                        message='Password and confirmation do not match',
                        action ='manage_main')

            self._doAddUser(username, password, roles, domains='', groups=groups, REQUEST=REQUEST)
            #
            # Explicitly check our contents, do not just acquire postUserCreate
            #
            if 'postUserCreate' in self.objectIds():
                  self.postUserCreate(self, REQUEST)
            
            return self.MessageDialog(self,REQUEST=REQUEST,
                  title = 'User Created',
                  message= 'User %s was created.'%(username),
                  action = 'manage_main')

      def _doAddUser(self, name, password, roles, domains='', groups=(), **kw):


Generated by  Doxygen 1.6.0   Back to index