Merge branch 'MDL-33514' of git://github.com/danpoltawski/moodle
This commit is contained in:
+6
-5
@@ -405,11 +405,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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user