Zhang Huangbin avatar Zhang Huangbin committed a55e89b

Code cleanup.

Comments (0)

Files changed (4)

controllers/ldap/basic.py

 import web
 from socket import getfqdn
 from urllib import urlencode
-from libs import __url_latest_ldap__, __version_ldap__, __no__, __id__
-from libs import iredutils, languages, settings
-from libs.ldaplib import auth, decorators, admin as adminlib, ldaputils, connUtils, attrs
+from libs import __url_latest_ose__, __version_ose__, __no__, __id__
+from libs import iredutils
+from libs.ldaplib import auth, decorators, admin as adminlib, ldaputils
 
 
 cfg = web.iredconfig
                 if len(r) == 0:
                     urlInfo = {
                         'a': cfg.general.get('webmaster', session.get('username', '')),
-                        'v': __version_ldap__,
+                        'v': __version_ose__,
                         'o': __no__,
                         'f': __id__,
                         'host': getfqdn(),
+                        'backend': cfg.general.get('backend', ''),
                     }
 
-                    url = __url_latest_ldap__ + '?' + urlencode(urlInfo)
+                    url = __url_latest_ose__ + '?' + urlencode(urlInfo)
                     newVersionInfo = iredutils.getNewVersion(url)
 
                     # Always remove all old records, just keep the last one.
 
         return web.render(
             'dashboard.html',
-            version=__version_ldap__,
+            version=__version_ose__,
             hostname=getfqdn(),
             uptime=iredutils.getServerUptime(),
             loadavg=os.getloadavg(),

controllers/mysql/basic.py

 from socket import getfqdn
 from urllib import urlencode
 import web
-from libs import __url_latest_mysql__, __version_mysql__, __no__, __id__
-from libs import iredutils, settings, languages
-from libs.mysql import core, decorators, admin as adminlib, connUtils
+from libs import __url_latest_ose__, __version_ose__, __no__, __id__
+from libs import iredutils, languages
+from libs.mysql import core, decorators
 
 
 cfg = web.iredconfig
                 if len(r) == 0:
                     urlInfo = {
                         'a': cfg.general.get('webmaster', session.get('username', '')),
-                        'v': __version_mysql__,
+                        'v': __version_ose__,
                         'o': __no__,
                         'f': __id__,
                         'host': getfqdn(),
+                        'backend': cfg.general.get('backend', ''),
                     }
 
-                    url = __url_latest_mysql__ + '?' + urlencode(urlInfo)
+                    url = __url_latest_ose__ + '?' + urlencode(urlInfo)
                     newVersionInfo = iredutils.getNewVersion(url)
 
                     # Always remove all old records, just keep the last one.
 
         return web.render(
             'dashboard.html',
-            version=__version_mysql__,
+            version=__version_ose__,
             hostname=getfqdn(),
             uptime=iredutils.getServerUptime(),
             loadavg=os.getloadavg(),

controllers/pgsql/basic.py

 from socket import getfqdn
 from urllib import urlencode
 import web
-from libs import __url_latest_pgsql__, __version_pgsql__, __no__, __id__
+from libs import __url_latest_ose__, __version_ose__, __no__, __id__
 from libs import iredutils, languages
 from libs.pgsql import core, decorators
 
                 if len(r) == 0:
                     urlInfo = {
                         'a': cfg.general.get('webmaster', session.get('username', '')),
-                        'v': __version_pgsql__,
+                        'v': __version_ose__,
                         'o': __no__,
                         'f': __id__,
                         'host': getfqdn(),
+                        'backend': cfg.general.get('backend', ''),
                     }
 
-                    url = __url_latest_pgsql__ + '?' + urlencode(urlInfo)
+                    url = __url_latest_ose__ + '?' + urlencode(urlInfo)
                     newVersionInfo = iredutils.getNewVersion(url)
 
                     # Always remove all old records, just keep the last one.
 
         return web.render(
             'dashboard.html',
-            version=__version_pgsql__,
+            version=__version_ose__,
             hostname=getfqdn(),
             uptime=iredutils.getServerUptime(),
             loadavg=os.getloadavg(),
 __author__ = 'Zhang Huangbin'
 __author_mail__ = 'zhb@iredmail.org'
-__version_ldap__ = '0.1.7'
-__version_mysql__ = '0.1.7'
-__version_pgsql__ = '0.1.7'
-__version_dbmail_mysql__ = '0.1.7'
-__url_latest_ldap__ = 'http://iredmail.org/version/check.py/ose.xml'
-__url_latest_mysql__ = 'http://iredmail.org/version/check.py/ose.xml'
-__url_latest_pgsql__ = 'http://iredmail.org/version/check.py/ose.xml'
-__url_latest_dbmail_mysql__ = 'http://iredmail.org/version/check.py/ose.xml'
+__version_ose = '0.1.7'
+__url_latest_ose__ = 'http://iredmail.org/version/check.py/ose.xml'
 __no__ = ''
 __id__ = ''
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.