def manage_addDocManager (self, id, title, description, webmaster, REQUEST=None): """ add a new DocManager object """ if id == '': id = utils().utGenRandomId() ownerinfo = REQUEST.AUTHENTICATED_USER.getUserName() ob = DocManager(id, title, description, webmaster, ownerinfo) ob._addRole(DOCMANAGER_ROLE_ADMINISTRATOR) ob._addRole(DOCMANAGER_ROLE_CONTRIBUTOR) self._setObject(id, ob) ob.loadDefaultContentTypes() ob.CreateCatalog() manage_addDocNotify(ob) manage_addAuthentication(ob) #ob.loadDefaultRoles() if REQUEST: return self.manage_main(self,REQUEST)
def send(self): """ Write myself to the file system """ id = utils().utGenRandomId(5) try: temp_path = os.tmpname(MAILDROP_SPOOL) except: temp_path = os.path.join(MAILDROP_SPOOL, id) lock = open('%s.lck' % temp_path, 'w') lock.write('locked') lock.close() temp = open(temp_path, 'w') temp.write(MAIL_TEMPLATE % (self.m_to, self.m_from, self.body)) temp.close() os.unlink('%s.lck' % temp_path)