Skip to content

Commit

Permalink
Merge branch 'MDL-33514-22' of git://github.com/danpoltawski/moodle i…
Browse files Browse the repository at this point in the history
…nto MOODLE_22_STABLE
  • Loading branch information
Sam Hemelryk committed Jul 8, 2012
2 parents 305fbe7 + e16922e commit 8e7d4f3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/rsslib.php
Expand Up @@ -346,11 +346,12 @@ function rss_geterrorxmlfile($errortype = 'rsserror') {

function rss_get_userid_from_token($token) {
global $DB;
$record = $DB->get_record('user_private_key', array('script'=>'rss','value' => $token), 'userid', IGNORE_MISSING);
if ($record) {
return $record->userid;
}
return null;

$sql = 'SELECT u.id FROM {user} u
JOIN {user_private_key} k ON u.id = k.userid
WHERE u.deleted = 0 AND u.confirmed = 1
AND u.suspended = 0 AND k.value = ?';
return $DB->get_field_sql($sql, array($token), IGNORE_MISSING);
}

function rss_get_token($userid) {
Expand Down

0 comments on commit 8e7d4f3

Please sign in to comment.