Commits

Zhang Huangbin committed 7a5d79c

Temporary disable per-user i18n.

  • Participants
  • Parent commits 4f4e87c

Comments (0)

Files changed (3)

File controllers/ldap/basic.py

                 web.config.session_parameters['timeout'] = 600      # 10 minutes
 
             # Per-user i18n.
+            '''
             try:
                 adminLib = admin.Admin()
                 lang = adminLib.getPreferredLanguage(userdn)
                     session['lang'] = lang
             except:
                 pass
+            '''
 
             web.seeother('/dashboard')
         else:

File controllers/ldap/domain.py

     @base.check_global_admin
     @base.protected
     def POST(self):
+        i = web.input()
         result = domainLib.add(data=i)
         if result[0] is True:
             web.seeother('/domains?msg=CREATED_SUCCESS')

File libs/ldaplib/admin.py

 
         mod_attrs = []
         if self.profile_type == 'general':
-            self.lang = web.safestr(data.get('preferredLanguage', 'en_US'))
-
-            mod_attrs += [ (ldap.MOD_REPLACE, 'preferredLanguage', self.lang) ]
+            # Get preferredLanguage.
+            #self.lang = web.safestr(data.get('preferredLanguage', 'en_US'))
+            #mod_attrs += [ (ldap.MOD_REPLACE, 'preferredLanguage', self.lang) ]
 
             cn = data.get('cn', None)
             mod_attrs += ldaputils.getSingleModAttr(attr='cn', value=cn, default=self.mail.split('@')[0],)
             try:
                 # Modify profiles.
                 self.conn.modify_s(self.dn, mod_attrs)
+                '''
                 if session.get('username') == self.mail:
                     web.render = iredutils.setRenderLang(web.render, self.lang, oldlang=session.get('lang'),)
                     session['lang'] = self.lang
+                '''
                 return (True,)
             except ldap.LDAPError, e:
                 return (False, ldaputils.getExceptionDesc(e))