rss MDL-22204 added library functions to allow the user to get a new rss token

This commit is contained in:
Andrew Davis 2010-05-12 06:48:59 +00:00
parent a1dc03b5eb
commit ffa3bfb36f
2 changed files with 16 additions and 4 deletions

View File

@ -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).
*

View File

@ -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