diff --git a/avisstage/templates/avisstage/base.html b/avisstage/templates/avisstage/base.html index 0755536..1aaf865 100644 --- a/avisstage/templates/avisstage/base.html +++ b/avisstage/templates/avisstage/base.html @@ -34,9 +34,9 @@
  • Modo
  • {% endif %} {% if user.is_authenticated %} -
  • {{ user.username }}
    Déconnexion
  • +
  • {{ user.username }}
    Déconnexion
  • {% else %} -
  • Connexion
  • +
  • Connexion
  • {% endif %} diff --git a/avisstage/templates/avisstage/index.html b/avisstage/templates/avisstage/index.html index 6a7ac27..679649e 100644 --- a/avisstage/templates/avisstage/index.html +++ b/avisstage/templates/avisstage/index.html @@ -11,7 +11,7 @@ {% if not user.is_authenticated %}
    -

    Connexion

    +

    Connexion

    Connexion via le serveur central d'authentification ENS (identifiants clipper)

    {% endif %} diff --git a/avisstage/urls.py b/avisstage/urls.py index 59f35b8..690e1b6 100644 --- a/avisstage/urls.py +++ b/avisstage/urls.py @@ -18,7 +18,7 @@ urlpatterns = [ url(r'^stages/majs/$', views.StageListe.as_view(), name='stage_majs'), url(r'^lieu/save/$', views.save_lieu, name='lieu_ajout'), - url(r'^profil/show/(?P\w+)/$', views.ProfilView.as_view(), + url(r'^profil/show/(?P[\w@]+)/$', views.ProfilView.as_view(), name='profil'), url(r'^profil/edit/$', views.ProfilEdit.as_view(), name='profil_edit'), url(r'^recherche/$', views.recherche, name='recherche'), diff --git a/experiENS/settings_base.py b/experiENS/settings_base.py index ce60550..52c8aee 100644 --- a/experiENS/settings_base.py +++ b/experiENS/settings_base.py @@ -29,11 +29,21 @@ INSTALLED_APPS = ( 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.gis', + 'django.contrib.sites', 'django_elasticsearch_dsl', + 'widget_tweaks', + 'allauth_ens', + + 'allauth', + 'allauth.account', + 'allauth.socialaccount', + 'allauth_cas', + + 'allauth_ens.providers.clipper', + 'tastypie', - 'django_cas_ng', 'braces', 'tinymce', 'taggit', @@ -94,6 +104,7 @@ USE_L10N = True USE_TZ = True +SITE_ID = 1 # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.7/howto/static-files/ @@ -112,9 +123,10 @@ CAS_REDIRECT_URL = reverse_lazy('avisstage:perso') CAS_EMAIL_FORMAT = "%s@clipper.ens.fr" CAS_FORCE_CHANGE_USERNAME_CASE = "lower" CAS_VERSION = 'CAS_2_SAML_1_0' +SOCIALACCOUNT_ADAPTER='allauth_ens.adapter.LongTermClipperAccountAdapter' -LOGIN_URL = reverse_lazy('login') -LOGOUT_URL = reverse_lazy('logout') +LOGIN_URL = reverse_lazy('account_login') +LOGOUT_URL = reverse_lazy('account_logout') LOGGING = { diff --git a/experiENS/settings_dev.py b/experiENS/settings_dev.py index b1a2e13..4dee8e4 100644 --- a/experiENS/settings_dev.py +++ b/experiENS/settings_dev.py @@ -34,3 +34,6 @@ ELASTICSEARCH_DSL = { 'hosts': 'localhost:9200' }, } + + +CLIPPER_LDAP_SERVER = 'ldaps://localhost:636' diff --git a/experiENS/urls.py b/experiENS/urls.py index c247442..91c6191 100644 --- a/experiENS/urls.py +++ b/experiENS/urls.py @@ -2,13 +2,11 @@ from django.conf import settings from django.conf.urls import include, url from django.contrib import admin -from django_cas_ng import views as django_cas_views - urlpatterns = [ url(r'^', include('avisstage.urls', namespace='avisstage')), - - url(r'^login/$', django_cas_views.login, name = "login"), - url(r'^logout/$', django_cas_views.logout, name = "logout"), + + url(r'^account/', include('allauth_ens.urls')), + url(r'^tinymce/', include('tinymce.urls')), url(r'^taggit_autosuggest/', include('taggit_autosuggest.urls')), url(r'^admin/', include(admin.site.urls)),