function tokenauth_reset in Token authentication 6
Same name and namespace in other branches
- 5 tokenauth.module \tokenauth_reset()
- 6.2 tokenauth.inc \tokenauth_reset()
- 7 tokenauth.inc \tokenauth_reset()
API function to reset all tokens.
Parameters
$uid: [optional] UID of a specific user to reset. Will default to resetting all users.
$token: [optional] A specific string to use as the token. Defaults to a string generated randomly with user_password().
$update: [optional] If true, will update the user's token entry. Otherwise will insert a new one.
Return value
For a single user, returns token string. For multiple users, returns TRUE.
5 calls to tokenauth_reset()
- drush_tokenauth_reset in ./
tokenauth.drush.inc - Drush command callback for "tokenauth-reset".
- drush_tokenauth_reset_all in ./
tokenauth.drush.inc - Drush command callback for "tokenauth-reset-all".
- tokenauth_insert in ./
tokenauth.inc - API Function to insert new user tokens.
- tokenauth_reset_confirm_submit in ./
tokenauth.pages.inc - Handler for reset tokens confirmation
- tokenauth_user_reset_confirm_submit in ./
tokenauth.pages.inc - Handler for reset tokens confirmation
1 string reference to 'tokenauth_reset'
- tokenauth_uninstall in ./
tokenauth.install - Implementation of hook_uninstall().
File
- ./
tokenauth.inc, line 21 - Provides tokenauth API for Token Authentication module.
Code
function tokenauth_reset($uid = NULL, $token = NULL, $update = TRUE) {
if (!is_null($uid)) {
return tokenauth_reset_user($uid, $token, $update);
}
else {
$sql = 'SELECT uid FROM {users} WHERE uid > 0';
$result = db_query($sql);
while ($row = db_fetch_object($result)) {
tokenauth_reset_user($row->uid, $token, $update);
}
return TRUE;
}
}