MDL-43119 Add valid until dates for tokens created by login/token.php

3 months were decided

Conflicts:
	login/token.php
This commit is contained in:
Juan Leyva
2014-05-07 16:12:03 +08:00
committed by Damyon Wiese
parent 7b9acc77ef
commit b5b2eab677
+2
View File
@@ -160,6 +160,8 @@ if (!empty($user)) {
$token->creatorid = $user->id;
$token->timecreated = time();
$token->externalserviceid = $service_record->id;
// MDL-43119 Token valid for 3 months (12 weeks).
$token->validuntil = $token->timecreated + 12 * WEEKSECS;
$tokenid = $DB->insert_record('external_tokens', $token);
add_to_log(SITEID, 'webservice', 'automatically create user token', '' , 'User ID: ' . $user->id);
$token->id = $tokenid;