Archived
Major update on the way to less users in LDAP
- Adds new app inside with models and moves related logic. - Working InsideAuthBackend with group sync - use passlib (<3) for MySQL hashes - Renames main app to neuf_userinfo - introduced local_settings.py
This commit is contained in:
1 parent
6f2add3270
commit
79a14fca02
47 files changed
+828
-329
No files matched your search
@@ -1,15 +1,17 @@
|
||||
import json, codecs, subprocess, os
|
||||
import json
|
||||
import codecs
|
||||
import subprocess
|
||||
import os
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "userinfosite.settings")
|
||||
from django.conf import settings
|
||||
|
||||
from main.models import *
|
||||
from neuf_userinfo.models import LdapGroup, LdapUser
|
||||
|
||||
PHP_SCRIPT_PATH = '/var/www/neuf.no/userinfo/scripts'
|
||||
OUT_FILENAME = os.path.join(PHP_SCRIPT_PATH,"users_in_group_active.json")
|
||||
OUT_FILENAME = os.path.join(PHP_SCRIPT_PATH, "users_in_group_active.json")
|
||||
|
||||
usernames = LdapGroup.objects.get(name="dns-aktiv").usernames
|
||||
usernames = LdapGroup.objects.get(posix_name="dns-aktiv").usernames
|
||||
users = LdapUser.objects.filter(username__in=usernames)
|
||||
users_out = [[u.username,u.first_name,u.last_name,u.email] for u in users]
|
||||
users_out = [[u.username, u.first_name, u.last_name, u.email] for u in users]
|
||||
|
||||
|
||||
out_file = codecs.open(OUT_FILENAME, "w", encoding="utf-8")
|
||||
@@ -29,4 +31,3 @@ for load_path in wp_load_paths:
|
||||
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
|
||||
script_response = proc.stdout.read()
|
||||
print script_response,
|
||||
|
||||
Reference in new issue
Block a user