Skip to content

Commit

Permalink
webservice MDL-12886 add function to retrieve token row by token (mus…
Browse files Browse the repository at this point in the history
…t be unique)
  • Loading branch information
mouneyrac committed Jun 3, 2010
1 parent 56dc41d commit bb98a5b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions webservice/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ public function delete_user_ws_token($tokenid) {
global $DB;
$DB->delete_records('external_tokens', array('id'=>$tokenid));
}

/**
* Get a user token by token
* @param string $token
* @throws moodle_exception if there is multiple result
*/
public function get_user_ws_token($token) {
global $DB;
return $DB->get_record('external_tokens', array('token'=>$token), '*', MUST_EXIST);
}
}


Expand Down

0 comments on commit bb98a5b

Please sign in to comment.