示例#1
0
 def _createInitialUser(self):
     """
     If there are no users or only one user in this user folder,
     populates from the 'inituser' file in the instance home.
     We have to do this even when there is already a user
     just in case the initial user ignored the setup messages.
     We don't do it for more than one user to avoid
     abuse of this mechanism.
     Called only by OFS.Application.initialize().
     """
     if len(self.data) <= 1:
         info = readUserAccessFile('inituser')
         if info:
             import App.config
             name, password, domains, remote_user_mode = info
             self._doDelUsers(self.getUserNames())
             self._doAddUser(name, password, ('Manager', ), domains)
             cfg = App.config.getConfiguration()
             try:
                 os.remove(os.path.join(cfg.instancehome, 'inituser'))
             except Exception:
                 pass
示例#2
0
 def _createInitialUser(self):
     """
     If there are no users or only one user in this user folder,
     populates from the 'inituser' file in the instance home.
     We have to do this even when there is already a user
     just in case the initial user ignored the setup messages.
     We don't do it for more than one user to avoid
     abuse of this mechanism.
     Called only by OFS.Application.initialize().
     """
     if len(self.data) <= 1:
         info = readUserAccessFile('inituser')
         if info:
             import App.config
             name, password, domains, remote_user_mode = info
             self._doDelUsers(self.getUserNames())
             self._doAddUser(name, password, ('Manager', ), domains)
             cfg = App.config.getConfiguration()
             try:
                 os.remove(os.path.join(cfg.instancehome, 'inituser'))
             except:
                 pass