cas
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 31 Oct 2012 09:29:23 +0000 (10:29 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 31 Oct 2012 09:29:23 +0000 (10:29 +0100)
prawokultury/settings.d/30-apps.conf
prawokultury/settings.d/40-auth.conf [new file with mode: 0755]
prawokultury/settings.d/40-middleware.conf
prawokultury/settings.d/50-contrib.conf
prawokultury/urls.py
requirements.txt

index 5aa5144..8d6bf16 100755 (executable)
@@ -12,6 +12,7 @@ INSTALLED_APPS = (
     'pagination',
     'sorl.thumbnail',
     'piwik.django',
     'pagination',
     'sorl.thumbnail',
     'piwik.django',
+    'django_cas',
 
     'django.contrib.auth',
     'django.contrib.contenttypes',
 
     'django.contrib.auth',
     'django.contrib.contenttypes',
diff --git a/prawokultury/settings.d/40-auth.conf b/prawokultury/settings.d/40-auth.conf
new file mode 100755 (executable)
index 0000000..675db9d
--- /dev/null
@@ -0,0 +1,5 @@
+if 'django_cas' in INSTALLED_APPS:
+    AUTHENTICATION_BACKENDS = (
+        'django.contrib.auth.backends.ModelBackend',
+        'django_cas.backends.CASBackend',
+    )
index eedc50e..2b07632 100755 (executable)
@@ -6,6 +6,14 @@ MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.middleware.common.CommonMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
+)
+
+if 'django_cas' in INSTALLED_APPS:
+    MIDDLEWARE_CLASSES += (
+        'django_cas.middleware.CASMiddleware',
+    )
+
+MIDDLEWARE_CLASSES += (
     'django.contrib.messages.middleware.MessageMiddleware',
     'piwik.django.middleware.PiwikMiddleware',
     # Uncomment the next line for simple clickjacking protection:
     'django.contrib.messages.middleware.MessageMiddleware',
     'piwik.django.middleware.PiwikMiddleware',
     # Uncomment the next line for simple clickjacking protection:
@@ -13,3 +21,5 @@ MIDDLEWARE_CLASSES = (
     'pagination.middleware.PaginationMiddleware',
     'realip_middleware.SetRemoteAddrFromXRealIP',
 )
     'pagination.middleware.PaginationMiddleware',
     'realip_middleware.SetRemoteAddrFromXRealIP',
 )
+
+
index 12d387e..27a516c 100755 (executable)
@@ -12,3 +12,6 @@ COMMENTS_XTD_LIST_URL_ACTIVE = True
 THUMBNAIL_QUALITY = 95
 
 GRAVATAR_DEFAULT_IMAGE = 'http://localhost:8000/static/img/avatar.png'
 THUMBNAIL_QUALITY = 95
 
 GRAVATAR_DEFAULT_IMAGE = 'http://localhost:8000/static/img/avatar.png'
+
+CAS_SERVER_URL = 'http://logowanie.nowoczesnapolska.org.pl/cas/'
+CAS_VERSION = '1'
index 4db309c..e1fb40b 100644 (file)
@@ -19,7 +19,15 @@ urlpatterns = patterns('',
     url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
             'document_root': settings.MEDIA_ROOT,
         }),
     url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
             'document_root': settings.MEDIA_ROOT,
         }),
-) + i18n_patterns('',
+    )
+
+if 'django_cas' in settings.INSTALLED_APPS:
+    urlpatterns += patterns('',
+        (r'^accounts/login/$', 'django_cas.views.login'),
+        (r'^accounts/logout/$', 'django_cas.views.logout'),
+    )
+
+urlpatterns += i18n_patterns('',
     url(string_concat(r'^', _('events'), r'/'), include('events.urls')),
     url(r'^comments/', include('django_comments_xtd.urls')),
 ) + migdal_urlpatterns 
     url(string_concat(r'^', _('events'), r'/'), include('events.urls')),
     url(r'^comments/', include('django_comments_xtd.urls')),
 ) + migdal_urlpatterns 
index eb707fd..79359e7 100644 (file)
@@ -1,4 +1,6 @@
 Django>=1.4,<1.5
 Django>=1.4,<1.5
+#django_cas
+-e hg+https://bitbucket.org/cpcc/django-cas@197f156ee943#egg=django_cas
 South>=0.7.4
 PIL
 sorl-thumbnail>=11.09,<12
 South>=0.7.4
 PIL
 sorl-thumbnail>=11.09,<12