-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from EsupPortail/dev
Dev - V2.6
- Loading branch information
Showing
152 changed files
with
4,800 additions
and
2,899 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Compiled source # | ||
# Compiled source # | ||
################### | ||
*.com | ||
*.class | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
default_app_config = 'pod.authentication.apps.AuthConfig' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,23 @@ | ||
from django.apps import AppConfig | ||
from django.db.models.signals import post_migrate | ||
|
||
|
||
def set_default_site(sender, **kwargs): | ||
from pod.authentication.models import GroupSite | ||
from pod.authentication.models import Owner | ||
from django.contrib.sites.models import Site | ||
for gs in GroupSite.objects.all(): | ||
if len(gs.sites.all()) == 0: | ||
gs.sites.add(Site.objects.get_current()) | ||
gs.save() | ||
for owner in Owner.objects.all(): | ||
if len(owner.sites.all()) == 0: | ||
owner.sites.add(Site.objects.get_current()) | ||
owner.save() | ||
|
||
|
||
class AuthConfig(AppConfig): | ||
name = 'auth' | ||
name = 'pod.authentication' | ||
|
||
def ready(self): | ||
post_migrate.connect(set_default_site, sender=self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from shibboleth.backends import ShibbolethRemoteUserBackend | ||
from django.contrib.sites.shortcuts import get_current_site | ||
|
||
|
||
class ShibbBackend(ShibbolethRemoteUserBackend): | ||
@staticmethod | ||
def update_user_params(user, params): | ||
super(ShibbBackend, | ||
ShibbBackend).update_user_params(user, params) | ||
user.owner.auth_type = "Shibboleth" | ||
if get_current_site(None) not in user.owner.sites.all(): | ||
user.owner.sites.add(get_current_site(None)) | ||
user.owner.save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from shibboleth.middleware import ShibbolethRemoteUserMiddleware | ||
from django.conf import settings | ||
|
||
REMOTE_USER_HEADER = getattr( | ||
settings, 'REMOTE_USER_HEADER', "REMOTE_USER") | ||
|
||
|
||
class ShibbMiddleware(ShibbolethRemoteUserMiddleware): | ||
header = REMOTE_USER_HEADER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.