MDL-43119 Add valid until dates for tokens created by login/token.php
authorJuan Leyva <juanleyvadelgado@gmail.com>
Wed, 7 May 2014 07:49:28 +0000 (15:49 +0800)
committerDamyon Wiese <damyon@moodle.com>
Wed, 7 May 2014 08:16:40 +0000 (16:16 +0800)
3 months were decided

login/token.php

index 919b97c..19a9eae 100644 (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;
             $token->id = $DB->insert_record('external_tokens', $token);
 
             $params = array(