Commits

Zhang Huangbin committed 0604be6

Fix error in ldaputils.convEmailToAdminDN.

  • Participants
  • Parent commits 65f2a71

Comments (0)

Files changed (2)

File controllers/ldap/urls.py

         '/checknew',                        'controllers.ldap.basic.checknew',
 
         # Preferences.
-        '/preferences',                     'controllers.ldap.preferences.Preferences',
+        '/preferences',                     'controllers.ldap.admin.profile',
 
         # Domain related.
         '/domains',                                     'controllers.ldap.domain.list',
         '/delete/domain',                               'controllers.ldap.domain.delete',
 
         # Admin related.
-        '/admins',                          'controllers.ldap.admin.list',
-        '/profile/admin/(%s)' % re_email,   'controllers.ldap.admin.profile',
-        '/create/admin',                    'controllers.ldap.admin.create',
-        '/delete/admin',                    'controllers.ldap.admin.delete',
+        '/admins',                                      'controllers.ldap.admin.list',
+        '/profile/admin/(general)/(%s)' % re_email,     'controllers.ldap.admin.profile',
+        '/profile/admin/(password)/(%s)' % re_email,    'controllers.ldap.admin.profile',
+        '/create/admin',                                'controllers.ldap.admin.create',
+        '/delete/admin',                                'controllers.ldap.admin.delete',
 
         # User related.
         # /domain.ltd/users

File libs/ldaplib/ldaputils.py

 
 def convEmailToAdminDN(email):
     """Convert email address to ldap dn of mail domain admin."""
-    mail = web.safestr(mail).strip()
-
     # Admin DN format.
     # mail=user@domain.ltd,[LDAP_DOMAINADMIN_DN]
-    dn = '%s=%s,%s' % ( attrs.USER_RDN, mail, domainadmin_dn)
+    dn = '%s=%s,%s' % ( attrs.USER_RDN, web.safestr(email).strip(), domainadmin_dn)
 
     return escape_filter_chars(dn)