VirtualMailManager/account.py
branchv0.6.x
changeset 561 b0165b7af7a3
parent 560 2662f4e17eb4
child 568 14abdd04ddf5
equal deleted inserted replaced
560:2662f4e17eb4 561:b0165b7af7a3
   249             raise AErr(_(u"No password set for account: '%s'") % self._addr,
   249             raise AErr(_(u"No password set for account: '%s'") % self._addr,
   250                        ACCOUNT_MISSING_PASSWORD)
   250                        ACCOUNT_MISSING_PASSWORD)
   251         self._prepare(MailLocation(self._dbh, mbfmt=cfg_dget('mailbox.format'),
   251         self._prepare(MailLocation(self._dbh, mbfmt=cfg_dget('mailbox.format'),
   252                                    directory=cfg_dget('mailbox.root')))
   252                                    directory=cfg_dget('mailbox.root')))
   253         dbc = self._dbh.cursor()
   253         dbc = self._dbh.cursor()
       
   254         qid = ssid = tid = None
       
   255         if self._qlimit:
       
   256             qid = self._qlimit.qid
       
   257         if self._services:
       
   258             ssid = self._services.ssid
       
   259         if self._transport:
       
   260             tid = self._transport.tid
   254         dbc.execute('INSERT INTO users (local_part, passwd, uid, gid, mid, '
   261         dbc.execute('INSERT INTO users (local_part, passwd, uid, gid, mid, '
   255                     'qid, ssid, tid, note) '
   262                     'qid, ssid, tid, note) '
   256                     'VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)',
   263                     'VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)',
   257                     (self._addr.localpart,
   264                     (self._addr.localpart,
   258                      pwhash(self._passwd, user=self._addr), self._uid,
   265                      pwhash(self._passwd, user=self._addr), self._uid,
   259                      self._domain.gid, self._mail.mid,
   266                      self._domain.gid, self._mail.mid, qid, ssid, tid,
   260                      self._qlimit.qid if self._qlimit else None,
   267 #                     self._qlimit.qid if self._qlimit else None,
   261                      self._services.ssid if self._services else None,
   268 #                     self._services.ssid if self._services else None,
   262                      self._transport.tid if self._transport else None,
   269 #                     self._transport.tid if self._transport else None,
   263                      self._note))
   270                      self._note))
   264         self._dbh.commit()
   271         self._dbh.commit()
   265         dbc.close()
   272         dbc.close()
   266         self._new = False
   273         self._new = False
   267 
   274