Merge branch 'MDL-67749-37' of git://github.com/dpalou/moodle into MOODLE_37_STABLE

This commit is contained in:
Sara Arjona
2020-03-03 09:30:50 +01:00
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -773,7 +773,8 @@ function external_generate_token($tokentype, $serviceorid, $userid, $contextorid
if (!empty($iprestriction)) {
$newtoken->iprestriction = $iprestriction;
}
$newtoken->privatetoken = null;
// Generate the private token, it must be transmitted only via https.
$newtoken->privatetoken = random_string(64);
$DB->insert_record('external_tokens', $newtoken);
return $newtoken->token;
}
+2 -1
View File
@@ -370,7 +370,8 @@ class webservice {
$newtoken->contextid = context_system::instance()->id;
$newtoken->creatorid = $userid;
$newtoken->timecreated = time();
$newtoken->privatetoken = null;
// Generate the private token, it must be transmitted only via https.
$newtoken->privatetoken = random_string(64);
$DB->insert_record('external_tokens', $newtoken);
}