mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
rss MDL-22204 added library functions to allow the user to get a new rss token
This commit is contained in:
parent
a1dc03b5eb
commit
ffa3bfb36f
@ -2528,6 +2528,19 @@ function create_user_key($script, $userid, $instance=null, $iprestriction=null,
|
||||
return $key->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the user's new private user access keys for a particular script.
|
||||
*
|
||||
* @global object
|
||||
* @param string $script unique target identifier
|
||||
* @param int $userid
|
||||
* @return void
|
||||
*/
|
||||
function delete_user_key($script,$userid) {
|
||||
global $DB;
|
||||
$DB->delete_records('user_private_key', array('script'=>$script, 'userid'=>$userid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a private user access key (and creates one if one doesn't exist).
|
||||
*
|
||||
|
@ -333,10 +333,9 @@ function rss_get_token($userid) {
|
||||
return get_user_key('rss', $userid);
|
||||
}
|
||||
|
||||
/*function rss_update_token_last_access($userid) {
|
||||
global $DB;
|
||||
$DB->set_field('rss_tokens', 'lastaccess', time(), array('userid'=>$userid));
|
||||
}*/
|
||||
function rss_delete_token($userid) {
|
||||
delete_user_key('rss', $userid);
|
||||
}
|
||||
|
||||
// ===== This function are used to write XML tags =========
|
||||
// [stronk7]: They are similar to the glossary export and backup generation
|
||||
|
Loading…
x
Reference in New Issue
Block a user