MDL-67749 ws: Set private token when reset or manual create token
This commit is contained in:
+2
-1
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user