Merge with new version of auth.py. Moves connection string to settings file,
authorMagnus Hagander <magnus@hagander.net>
Wed, 4 Mar 2009 09:59:57 +0000 (10:59 +0100)
committerMagnus Hagander <magnus@hagander.net>
Wed, 4 Mar 2009 09:59:57 +0000 (10:59 +0100)
and inherits from the model authentication system so we support groups in
the admin interface.

gitadmin/auth.py
gitadmin/settings.py

index 3fed0b445541e4e4740b460122330a4044be30bd..66356b712ac2026bbc451e27b21d088821e923cf 100644 (file)
@@ -1,9 +1,11 @@
 from django.contrib.auth.models import User
+from django.contrib.auth.backends import ModelBackend
+from django.conf import settings
 import psycopg2
 
-class AuthBackend:
+class AuthBackend(ModelBackend):
        def authenticate(self, username=None, password=None):
-               conn = psycopg2.connect('host=wwwmaster.postgresql.org dbname=186_www user=auth_svc password=g7y3m9u8 sslmode=require')
+               conn = psycopg2.connect(settings.AUTH_CONNECTION_STRING)
                try:
                        conn.set_client_encoding('UNICODE')
                        cur = conn.cursor()
index 3064830bad8d558b5fd628197dd4ab5bb419df92..67df9d2e044c002177b1ffaf7c24679343c9c97a 100644 (file)
@@ -92,6 +92,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
 
 LOGIN_URL = '/adm/login'
 
+AUTH_CONNECTION_STRING="override authentication connection string in the local settings file"
 
 # If there is a local_settings.py, let it override our settings
 try: