Commits

Zhang Huangbin committed 7e4231a

Fix last commit.

  • Participants
  • Parent commits 1345362

Comments (0)

Files changed (1)

File libs/ldaplib/auth.py

                     session['domainGlobalAdmin'] = True
 
                 if 'mailUser' in entry.get('objectClass'):
-                    if 'domainadmin' in entry.get('enabledService', []):
+                    session['isMailUser'] = True
+
+                    # Make sure user have 'domainGlobalAdmin=yes' for global
+                    # admin or 'enabledService=domainadmin' for domain admin.
+                    if not session.get('domainGlobalAdmin') \
+                       or not 'domainadmin' in entry.get('enabledService', []):
                         return False
-                    session['isMailUser'] = True
 
                 conn.unbind_s()
                 return True