Commits

Zhang Huangbin committed 928461f

Don't show language selection drop-down box in login page.

Comments (0)

Files changed (13)

controllers/ldap/basic.py

 
 import web, sys
 from libs import __version__, __url_iredadmin_lastest__, iredutils
-from libs.ldaplib import core, admin, auth, domain, ldaputils
+from libs.ldaplib import core, auth, domain, ldaputils
 from controllers.ldap import base
 
 cfg = web.iredconfig
         else:
             i = web.input()
 
-            adminLib = admin.Admin()
-            cur_lang = i.get('lang', cfg.general.get('lang', 'en_US'))
-            if cur_lang is not None and cur_lang in adminLib.getLanguageMaps().keys():
-                session['lang'] = cur_lang
-
             # Show login page.
-            return render.login(
-                    cur_lang=cur_lang,
-                    languagemaps=adminLib.getLanguageMaps(),
-                    msg=i.get('msg'),
-                    )
+            return render.login(msg=i.get('msg'),)
 
     def POST(self):
         # Get username, password.

i18n/en_US/LC_MESSAGES/iredadmin.mo

Binary file modified.

i18n/en_US/LC_MESSAGES/iredadmin.po

 "Project-Id-Version: iRedAdmin 0.1.1\n"
 "Report-Msgid-Bugs-To: michaelbibby@gmail.com\n"
 "POT-Creation-Date: 2009-10-03 23:01+0800\n"
-"PO-Revision-Date: 2009-10-23 16:32+0800\n"
+"PO-Revision-Date: 2009-10-25 11:13+0800\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: en_US <LL@li.org>\n"
 "Plural-Forms: nplurals=2; plural=(n != 1)\n"
 msgstr ""
 
 #: ../templates/default/ldap/admins.html:33
+#: ../templates/default/ldap/domains.html:33
 #: ../templates/default/ldap/users.html:45
 #, python-format
 msgid "Total: %s."
 msgid "All domains under your control."
 msgstr ""
 
-#: ../templates/default/ldap/domains.html:33
-msgid "Total:"
-msgstr ""
-
 #: ../templates/default/ldap/domains.html:71
 msgid "Edit domain profile"
 msgstr ""
 msgid "Password"
 msgstr ""
 
-#: ../templates/default/ldap/login.html:77
-#: ../templates/default/ldap/macros.html:103
-msgid "Preferred language"
-msgstr ""
-
-#: ../templates/default/ldap/login.html:91
+#: ../templates/default/ldap/login.html:78
 msgid "Remember me"
 msgstr ""
 
-#: ../templates/default/ldap/login.html:91
+#: ../templates/default/ldap/login.html:78
 msgid "Log me in automatically each time I visit."
 msgstr ""
 
-#: ../templates/default/ldap/login.html:97
+#: ../templates/default/ldap/login.html:84
 msgid "Login"
 msgstr ""
 
 msgid "Telephone Number"
 msgstr ""
 
+#: ../templates/default/ldap/macros.html:103
+msgid "Preferred language"
+msgstr ""
+
 #: ../templates/default/ldap/macros.html:124
 msgid "Enable this domain"
 msgstr ""
 msgid "Quota"
 msgstr ""
 
+#~ msgid "Total:"
+#~ msgstr ""
+

i18n/fr_FR/LC_MESSAGES/iredadmin.mo

Binary file modified.

i18n/fr_FR/LC_MESSAGES/iredadmin.po

 "Project-Id-Version: iRedAdmin 0.1.1\n"
 "Report-Msgid-Bugs-To: michaelbibby@gmail.com\n"
 "POT-Creation-Date: 2009-10-04 00:45+0800\n"
-"PO-Revision-Date: 2009-10-23 16:32+0800\n"
+"PO-Revision-Date: 2009-10-25 11:13+0800\n"
 "Last-Translator: Mael LE SAOUT <mael.lesaout@gmail.com>\n"
 "Language-Team: fr_FR <LL@li.org>\n"
 "Plural-Forms: nplurals=2; plural=(n > 1)\n"
 msgstr "Tous les administrateurs de messagerie."
 
 #: ../templates/default/ldap/admins.html:33
+#: ../templates/default/ldap/domains.html:33
 #: ../templates/default/ldap/users.html:45
 #, python-format
 msgid "Total: %s."
 msgid "All domains under your control."
 msgstr "Tous les domaines sous votre controle."
 
-#: ../templates/default/ldap/domains.html:33
-msgid "Total:"
-msgstr "Total: %s."
-
 #: ../templates/default/ldap/domains.html:71
 msgid "Edit domain profile"
 msgstr "Modifier le profil du domaine."
 msgid "Password"
 msgstr "Mot de passe"
 
-#: ../templates/default/ldap/login.html:77
-#: ../templates/default/ldap/macros.html:103
-msgid "Preferred language"
-msgstr "Langage par défaut"
-
-#: ../templates/default/ldap/login.html:91
+#: ../templates/default/ldap/login.html:78
 msgid "Remember me"
 msgstr "Se souvenir de moi"
 
-#: ../templates/default/ldap/login.html:91
+#: ../templates/default/ldap/login.html:78
 msgid "Log me in automatically each time I visit."
 msgstr "Me connecter automatiquement à chaque fois que je visite."
 
-#: ../templates/default/ldap/login.html:97
+#: ../templates/default/ldap/login.html:84
 msgid "Login"
 msgstr "Connexion"
 
 msgid "Telephone Number"
 msgstr "Numéro de téléphone"
 
+#: ../templates/default/ldap/macros.html:103
+msgid "Preferred language"
+msgstr "Langage par défaut"
+
 #: ../templates/default/ldap/macros.html:124
 msgid "Enable this domain"
 msgstr "Activer ce domaine"
 msgid "Quota"
 msgstr "Quota"
 
+#~ msgid "Total:"
+#~ msgstr "Total: %s."
+

i18n/iredadmin.po

 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: michaelbibby@gmail.com\n"
-"POT-Creation-Date: 2009-10-23 16:32+0800\n"
+"POT-Creation-Date: 2009-10-25 11:13+0800\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 msgstr ""
 
 #: ../templates/default/ldap/admins.html:33
+#: ../templates/default/ldap/domains.html:33
 #: ../templates/default/ldap/users.html:45
 #, python-format
 msgid "Total: %s."
 msgid "All domains under your control."
 msgstr ""
 
-#: ../templates/default/ldap/domains.html:33
-msgid "Total:"
-msgstr ""
-
 #: ../templates/default/ldap/domains.html:71
 msgid "Edit domain profile"
 msgstr ""
 msgid "Password"
 msgstr ""
 
-#: ../templates/default/ldap/login.html:77
-#: ../templates/default/ldap/macros.html:103
-msgid "Preferred language"
-msgstr ""
-
-#: ../templates/default/ldap/login.html:91
+#: ../templates/default/ldap/login.html:78
 msgid "Remember me"
 msgstr ""
 
-#: ../templates/default/ldap/login.html:91
+#: ../templates/default/ldap/login.html:78
 msgid "Log me in automatically each time I visit."
 msgstr ""
 
-#: ../templates/default/ldap/login.html:97
+#: ../templates/default/ldap/login.html:84
 msgid "Login"
 msgstr ""
 
 msgid "Telephone Number"
 msgstr ""
 
+#: ../templates/default/ldap/macros.html:103
+msgid "Preferred language"
+msgstr ""
+
 #: ../templates/default/ldap/macros.html:124
 msgid "Enable this domain"
 msgstr ""

i18n/vi_VN/LC_MESSAGES/iredadmin.mo

Binary file modified.

i18n/vi_VN/LC_MESSAGES/iredadmin.po

 "Project-Id-Version: iRedAdmin 0.1.1\n"
 "Report-Msgid-Bugs-To: michaelbibby@gmail.com\n"
 "POT-Creation-Date: 2009-10-02 01:16+0800\n"
-"PO-Revision-Date: 2009-10-23 16:32+0800\n"
+"PO-Revision-Date: 2009-10-25 11:13+0800\n"
 "Last-Translator: Lâm Minh Thông <lmthong@gmail.com>\n"
 "Language-Team: vi_VN <LL@li.org>\n"
 "Plural-Forms: nplurals=1; plural=0\n"
 msgstr "Tất cả các quản trị viên"
 
 #: ../templates/default/ldap/admins.html:33
+#: ../templates/default/ldap/domains.html:33
 #: ../templates/default/ldap/users.html:45
 #, python-format
 msgid "Total: %s."
 msgid "All domains under your control."
 msgstr "Bạn có thể quản lý tất cả các tên miền."
 
-#: ../templates/default/ldap/domains.html:33
-msgid "Total:"
-msgstr "Tổng cộng: %s."
-
 #: ../templates/default/ldap/domains.html:71
 msgid "Edit domain profile"
 msgstr "Sửa thông tin tên miền"
 msgid "Password"
 msgstr "Mật khẩu"
 
-#: ../templates/default/ldap/login.html:77
-#: ../templates/default/ldap/macros.html:103
-msgid "Preferred language"
-msgstr "Ngôn ngữ mặc định"
-
-#: ../templates/default/ldap/login.html:91
+#: ../templates/default/ldap/login.html:78
 msgid "Remember me"
 msgstr "Ghi nhớ tài khoản này"
 
-#: ../templates/default/ldap/login.html:91
+#: ../templates/default/ldap/login.html:78
 msgid "Log me in automatically each time I visit."
 msgstr "Giúp tôi tự động đăng nhập."
 
-#: ../templates/default/ldap/login.html:97
+#: ../templates/default/ldap/login.html:84
 msgid "Login"
 msgstr "Đăng nhập"
 
 msgid "Telephone Number"
 msgstr "Số điện thoại"
 
+#: ../templates/default/ldap/macros.html:103
+msgid "Preferred language"
+msgstr "Ngôn ngữ mặc định"
+
 #: ../templates/default/ldap/macros.html:124
 msgid "Enable this domain"
 msgstr "Kích hoạt tên miền này"
 msgid "Quota"
 msgstr "Quota"
 
+#~ msgid "Total:"
+#~ msgstr "Tổng cộng: %s."
+

i18n/zh_CN/LC_MESSAGES/iredadmin.mo

Binary file modified.

i18n/zh_CN/LC_MESSAGES/iredadmin.po

 "Project-Id-Version: iRedAdmin 0.1.1\n"
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
 "POT-Creation-Date: 2009-10-13 14:15+0800\n"
-"PO-Revision-Date: 2009-10-23 16:32+0800\n"
+"PO-Revision-Date: 2009-10-25 11:13+0800\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: zh_CN <LL@li.org>\n"
 "Plural-Forms: nplurals=1; plural=0\n"
 msgstr "所有域管理员。"
 
 #: ../templates/default/ldap/admins.html:33
+#: ../templates/default/ldap/domains.html:33
 #: ../templates/default/ldap/users.html:45
 #, python-format
 msgid "Total: %s."
 msgid "All domains under your control."
 msgstr "您管理的所有邮件域。"
 
-#: ../templates/default/ldap/domains.html:33
-msgid "Total:"
-msgstr "总共 %s 个。"
-
 #: ../templates/default/ldap/domains.html:71
 msgid "Edit domain profile"
 msgstr "编辑域属性"
 msgid "Password"
 msgstr "密码"
 
-#: ../templates/default/ldap/login.html:77
-#: ../templates/default/ldap/macros.html:103
-msgid "Preferred language"
-msgstr "偏好的语言"
-
-#: ../templates/default/ldap/login.html:91
+#: ../templates/default/ldap/login.html:78
 msgid "Remember me"
 msgstr "记住我"
 
-#: ../templates/default/ldap/login.html:91
+#: ../templates/default/ldap/login.html:78
 msgid "Log me in automatically each time I visit."
 msgstr "每次访问时自动登录"
 
-#: ../templates/default/ldap/login.html:97
+#: ../templates/default/ldap/login.html:84
 msgid "Login"
 msgstr "登录"
 
 msgid "Telephone Number"
 msgstr "电话号码"
 
+#: ../templates/default/ldap/macros.html:103
+msgid "Preferred language"
+msgstr "偏好的语言"
+
 #: ../templates/default/ldap/macros.html:124
 msgid "Enable this domain"
 msgstr "启用这个域"
 #: ../templates/default/ldap/users.html:70
 msgid "Quota"
 msgstr "容量"
-

libs/ldaplib/auth.py

                 else:
                     pass
 
-                # Update preferred language.
-                try:
-                    conn.modify_s(dn, [( ldap.MOD_REPLACE, 'preferredlanguage', web.safestr(session.get('lang', 'en_US')) )])
-                except:
-                    pass
-
                 return True
             else:
                 return False

templates/default/ldap/domains.html

 {% block navlinks_active_domains %}active{% endblock %}
 
 {% block id_welcome %}
-<span>{{ _('All domains under your control.') }} {{ _('Total:') }} {{ allDomains|length }}</span>
+<span>{{ _('All domains under your control.') }} {{ _('Total: %s.') |format(allDomains|length) }}</span>
 {% endblock id_welcome %}
 
 {% block id_visit_links %}

templates/default/ldap/login.html

                 </div>
 
                 <div class="sf-set">
-                    <div class="sf-box text required">
-                        <label><span>{{ _('Preferred language') }}</span></label><br />
-                        <span class="fld-input">
-                            <select id="selectLang" name="lang" onchange="changeUrl(this, baseurl='{{ctx.homepath}}/login?lang=');">
-                            {% for lang in languagemaps %}
-                                <option value="{{lang}}" {% if lang == cur_lang %}selected{%endif%}>{{languagemaps[lang]}}</option>
-                            {% endfor %}
-                            </select>
-                        </span>
-                    </div>
-                </div>
-
-                <div class="sf-set">
                     <div class="sf-box checkbox">
                         <span class="fld-input"><input type="checkbox" name="save_pass" value="yes" /></span>
                         <label><span>{{ _('Remember me')}} </span>{{ _('Log me in automatically each time I visit.') }}</label>