mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-20 16:05:37 +00:00
parent
57c8fa967c
commit
62c2f0bc9e
@ -18,18 +18,21 @@ from seahub.base.accounts import User
|
|||||||
from seahub.base.sudo_mode import update_sudo_mode_ts
|
from seahub.base.sudo_mode import update_sudo_mode_ts
|
||||||
from seahub.profile.models import Profile
|
from seahub.profile.models import Profile
|
||||||
from seahub.utils.file_size import get_quota_from_string
|
from seahub.utils.file_size import get_quota_from_string
|
||||||
from seahub.utils.user_permissions import get_user_role
|
|
||||||
|
|
||||||
# Get an instance of a logger
|
# Get an instance of a logger
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
try:
|
||||||
conf_dir = os.environ['SEAFILE_CENTRAL_CONF_DIR']
|
conf_dir = os.environ['SEAFILE_CENTRAL_CONF_DIR']
|
||||||
sys.path.append(conf_dir)
|
sys.path.append(conf_dir)
|
||||||
try:
|
try:
|
||||||
from seahub_custom_functions import custom_shibboleth_get_user_role
|
from seahub_custom_functions import custom_shibboleth_get_user_role
|
||||||
CUSTOM_SHIBBOLETH_GET_USER_ROLE = True
|
CUSTOM_SHIBBOLETH_GET_USER_ROLE = True
|
||||||
except ImportError as e:
|
except ImportError:
|
||||||
CUSTOM_SHIBBOLETH_GET_USER_ROLE = False
|
CUSTOM_SHIBBOLETH_GET_USER_ROLE = False
|
||||||
|
except KeyError:
|
||||||
|
CUSTOM_SHIBBOLETH_GET_USER_ROLE = False
|
||||||
|
|
||||||
|
|
||||||
class ShibbolethRemoteUserMiddleware(RemoteUserMiddleware):
|
class ShibbolethRemoteUserMiddleware(RemoteUserMiddleware):
|
||||||
"""
|
"""
|
||||||
@ -253,5 +256,6 @@ class ShibbolethRemoteUserMiddleware(RemoteUserMiddleware):
|
|||||||
error = True
|
error = True
|
||||||
return shib_attrs, error
|
return shib_attrs, error
|
||||||
|
|
||||||
|
|
||||||
class ShibbolethValidationError(Exception):
|
class ShibbolethValidationError(Exception):
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user