Source

iredadmin-ose / libs / mysql / domain.py

Diff from to

libs/mysql/domain.py

 # Author: Zhang Huangbin <zhb@iredmail.org>
 
 import web
-from libs import iredutils, settings
+import settings
+from libs import iredutils
 from libs.mysql import core, decorators, connUtils
 
-cfg = web.iredconfig
 session = web.config.get('_session')
 
 
             OFFSET %d
         """ % (sql_where, settings.PAGE_SIZE_LIMIT, (page - 1) * settings.PAGE_SIZE_LIMIT,)
 
-        if self.isGlobalAdmin(admin):
+        if self.is_global_admin(admin):
             try:
                 resultOfTotal = self.conn.select(
                     'domain',
                 'domain',
                 domain=domain,
                 description=cn,
-                transport=cfg.general.get('transport', 'dovecot'),
-                created=iredutils.getGMTTime(),
+                transport=settings.default_mta_transport,
+                created=iredutils.get_gmttime(),
                 active='1',
             )
             web.logger(msg="Create domain: %s." % (domain), domain=domain, event='create',)
         domain = str(domain)
 
         # Pre-defined update key:value.
-        updates = {'modified': iredutils.getGMTTime(), }
+        updates = {'modified': iredutils.get_gmttime(), }
 
         sql_vars = {'domain': domain, }