Skip to content

Commit

Permalink
MDL-30043 token.php should not return a mix of EXTERNAL_TOKEN_PERMANE…
Browse files Browse the repository at this point in the history
…NT and EXTERNAL_TOKEN_EMBEDDED
  • Loading branch information
mouneyrac committed Nov 2, 2011
1 parent fae4f8f commit 500ba8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions login/token.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@
// It does not really matter we take the first one that is valid.
$tokenssql = "SELECT t.id, t.sid, t.token, t.validuntil, t.iprestriction
FROM {external_tokens} t
WHERE t.userid = ? AND t.externalserviceid = ?
WHERE t.userid = ? AND t.externalserviceid = ? AND t.tokentype = ?
ORDER BY t.timecreated ASC";
$tokens = $DB->get_records_sql($tokenssql, array($user->id, $service->id));
$tokens = $DB->get_records_sql($tokenssql, array($user->id, $service->id, EXTERNAL_TOKEN_PERMANENT));

//A bit of sanity checks
foreach ($tokens as $key=>$token) {
Expand Down

0 comments on commit 500ba8b

Please sign in to comment.