浏览代码

Add an LDAP user to the default group at import time

Jon Natkins 13 年之前
父节点
当前提交
980aa3cb8a
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      apps/useradmin/src/useradmin/views.py

+ 4 - 0
apps/useradmin/src/useradmin/views.py

@@ -373,6 +373,10 @@ def _import_ldap_user(username, import_by_dn=False):
     LOG.warn('There was a naming conflict while importing user %s' % (username,))
     return None
 
+  default_group = get_default_user_group()
+  if created and default_group is not None:
+    user.groups.add(default_group)
+
   if 'first' in user_info:
     user.first_name = user_info['first']
   if 'last' in user_info: