mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-74042 vimeo: Support security hash for restricted videos
This commit is contained in:
parent
9cd77c4130
commit
c112780113
1 changed files with 5 additions and 0 deletions
|
@ -40,6 +40,7 @@ $token = required_param('token', PARAM_ALPHANUM);
|
||||||
$video = required_param('video', PARAM_ALPHANUM); // Video ids are numeric, but it's more solid to expect things like 00001.
|
$video = required_param('video', PARAM_ALPHANUM); // Video ids are numeric, but it's more solid to expect things like 00001.
|
||||||
$width = optional_param('width', 0, PARAM_INT);
|
$width = optional_param('width', 0, PARAM_INT);
|
||||||
$height = optional_param('height', 0, PARAM_INT);
|
$height = optional_param('height', 0, PARAM_INT);
|
||||||
|
$h = optional_param('h', '', PARAM_ALPHANUM); // Security hash for restricted videos.
|
||||||
|
|
||||||
// Authenticate the user.
|
// Authenticate the user.
|
||||||
$webservicelib = new webservice();
|
$webservicelib = new webservice();
|
||||||
|
@ -52,6 +53,10 @@ if (empty($width) && empty($height)) {
|
||||||
$display = "width=\"$width\" height=\"$height\"";
|
$display = "width=\"$width\" height=\"$height\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($h)) {
|
||||||
|
$video .= '?h=' . $h;
|
||||||
|
}
|
||||||
|
|
||||||
$output = <<<OET
|
$output = <<<OET
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue