Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LabNbook
LabNbook-Moodle
Commits
0b6f8348
Verified
Commit
0b6f8348
authored
Mar 16, 2021
by
David Beniamine
Browse files
Better url detection
parent
2fd5b893
Changes
1
Hide whitespace changes
Inline
Side-by-side
user-binding.php
View file @
0b6f8348
...
...
@@ -23,5 +23,6 @@ $isTeacher = has_capability('mod/labnbook:addinstance', $context);
$role
=
(
$isTeacher
?
'teacher'
:
'learner'
);
global
$USER
;
$url
=
$fetchInstitution
->
getRedirectUrl
();
$token
=
$fetchInstitution
->
getBindingTokenForRedirect
(
$returnUrl
,
$role
,
$USER
);
$actual_link
=
(
isset
(
$_SERVER
[
'HTTPS'
])
&&
$_SERVER
[
'HTTPS'
]
===
'on'
?
"https"
:
"http"
)
.
"://
$_SERVER[HTTP_HOST]$returnUrl
"
;
$token
=
$fetchInstitution
->
getBindingTokenForRedirect
(
$actual_link
,
$role
,
$USER
);
redirect
(
$url
.
"?token="
.
$token
);
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment