Commit 1a1a1649 authored by Nicholas Anderson's avatar Nicholas Anderson

Fixed LDAP login for some dumb reason

parent 577039d1
......@@ -80,7 +80,6 @@ MIDDLEWARE_CLASSES = (
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'cas.middleware.CASMiddleware',
)
ROOT_URLCONF = 'settings.urls'
......@@ -101,7 +100,6 @@ INSTALLED_APPS = (
'qrcode',
'captcha',
'crispy_forms',
'cas',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)
......@@ -177,6 +175,14 @@ elif AUTH_MODE.lower() == 'cas':
'go.cas_callbacks.create_user',
)
INSTALLED_APPS += (
'cas',
)
MIDDLEWARE_CLASSES += (
'cas.middleware.CASMiddleware',
)
PIWIK_SITE_ID = secret.PIWIK_SITE_ID
PIWIK_URL = secret.PIWIK_URL
......
......@@ -2,6 +2,8 @@ from django.conf.urls import patterns, include, url
import go.views
import django.contrib.auth.views
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
handle404 = "error_404"
......@@ -35,13 +37,20 @@ urlpatterns = [
# /useradmin - user approval interface
url(r'^useradmin/?$', go.views.useradmin, name='useradmin'),
]
urlpatterns += [
# Auth pages
url(r'^login$', django.contrib.auth.views.login, name='go_login'),
url(r'^logout$', django.contrib.auth.views.logout, {'next_page': '/'},
name='go_logout'),
]
if settings.AUTH_MODE.lower() == "ldap":
urlpatterns += [
# Auth pages
url(r'^login$', django.contrib.auth.views.login, {'template_name' : 'core/login.html'}, name='go_login'),
url(r'^logout$', django.contrib.auth.views.logout, {'next_page': '/'},
name='go_logout'),
]
else:
urlpatterns += [
# Auth pages
url(r'^login$', django.contrib.auth.views.login, name='go_login'),
url(r'^logout$', django.contrib.auth.views.logout, {'next_page': '/'},
name='go_logout'),
]
urlpatterns += [
# Redirection regex.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment