mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-21 19:37:28 +00:00
Merge branch '5.1'
Conflicts: seahub/base/accounts.py seahub/share/views.py seahub/views/sysadmin.py tests/seahub/base/test_accounts.py tests/seahub/share/views/test_ajax_get_download_link.py tests/seahub/share/views/test_ajax_get_upload_link.py
This commit is contained in:
@@ -10,6 +10,7 @@ import csv, chardet, StringIO
|
||||
import time
|
||||
from constance import config
|
||||
|
||||
from django.db.models import Q
|
||||
from django.conf import settings as dj_settings
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.contrib import messages
|
||||
@@ -1534,10 +1535,24 @@ def user_search(request):
|
||||
"""
|
||||
email = request.GET.get('email', '')
|
||||
|
||||
users = ccnet_threaded_rpc.search_emailusers('DB', email, -1, -1)
|
||||
ldap_users = ccnet_threaded_rpc.search_emailusers('LDAP', email, -1, -1)
|
||||
# search user from ccnet db
|
||||
users = ccnet_api.search_emailusers('DB', email, -1, -1)
|
||||
|
||||
# search user from ccnet ldap
|
||||
ldap_users = ccnet_api.search_emailusers('LDAP', email, -1, -1)
|
||||
users.extend(ldap_users)
|
||||
|
||||
# search user from profile
|
||||
users_from_profile = Profile.objects.filter((Q(nickname__icontains=email)) |
|
||||
Q(contact_email__icontains=email))
|
||||
|
||||
for user in users_from_profile:
|
||||
try:
|
||||
user_obj = User.objects.get(email=user.user)
|
||||
except User.DoesNotExist:
|
||||
continue
|
||||
users.append(user_obj)
|
||||
|
||||
last_logins = UserLastLogin.objects.filter(username__in=[x.email for x in users])
|
||||
if ENABLE_TRIAL_ACCOUNT:
|
||||
trial_users = TrialAccount.objects.filter(user_or_org__in=[x.email for x in users])
|
||||
|
Reference in New Issue
Block a user