mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-12 21:30:39 +00:00
sudo mode: handle shibboleth login
This commit is contained in:
@@ -4,6 +4,7 @@ from django.core.exceptions import ImproperlyConfigured
|
||||
from shibboleth.app_settings import SHIB_ATTRIBUTE_MAP, LOGOUT_SESSION_KEY, SHIB_USER_HEADER
|
||||
|
||||
from seahub import auth
|
||||
from seahub.base.sudo_mode import update_sudo_mode_ts
|
||||
|
||||
class ShibbolethRemoteUserMiddleware(RemoteUserMiddleware):
|
||||
"""
|
||||
@@ -45,6 +46,8 @@ class ShibbolethRemoteUserMiddleware(RemoteUserMiddleware):
|
||||
# persisted in the session and we don't need to continue.
|
||||
if request.user.is_authenticated():
|
||||
if request.user.username == username:
|
||||
if request.user.is_staff:
|
||||
update_sudo_mode_ts(request)
|
||||
return
|
||||
|
||||
# Make sure we have all required Shiboleth elements before proceeding.
|
||||
|
Reference in New Issue
Block a user