mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-36754 core_files: Add a token version of pluginfile
This commit is contained in:
parent
6e445671c1
commit
4a74ab0200
5 changed files with 150 additions and 5 deletions
|
@ -3112,9 +3112,10 @@ function validate_user_key($keyvalue, $script, $instance) {
|
|||
* @uses PARAM_ALPHANUM
|
||||
* @param string $script unique script identifier
|
||||
* @param int $instance optional instance id
|
||||
* @param string $keyvalue The key. If not supplied, this will be fetched from the current session.
|
||||
* @return int Instance ID
|
||||
*/
|
||||
function require_user_key_login($script, $instance=null) {
|
||||
function require_user_key_login($script, $instance = null, $keyvalue = null) {
|
||||
global $DB;
|
||||
|
||||
if (!NO_MOODLE_COOKIES) {
|
||||
|
@ -3124,7 +3125,9 @@ function require_user_key_login($script, $instance=null) {
|
|||
// Extra safety.
|
||||
\core\session\manager::write_close();
|
||||
|
||||
$keyvalue = required_param('key', PARAM_ALPHANUM);
|
||||
if (null === $keyvalue) {
|
||||
$keyvalue = required_param('key', PARAM_ALPHANUM);
|
||||
}
|
||||
|
||||
$key = validate_user_key($keyvalue, $script, $instance);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue