本文整理匯總了PHP中webservice::get_user_ws_tokens方法的典型用法代碼示例。如果您正苦於以下問題:PHP webservice::get_user_ws_tokens方法的具體用法?PHP webservice::get_user_ws_tokens怎麽用?PHP webservice::get_user_ws_tokens使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類webservice
的用法示例。
在下文中一共展示了webservice::get_user_ws_tokens方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
$wsrenderer = $PAGE->get_renderer('core', 'webservice');
if ($action == 'resetwstoken') {
$token = $webservice->get_created_by_user_ws_token($USER->id, $tokenid);
// Display confirmation page to Reset the token.
if (!$confirm) {
$resetconfirmation = $wsrenderer->user_reset_token_confirmation($token);
} else {
// Delete the token that need to be regenerated.
$webservice->delete_user_ws_token($tokenid);
}
}
// No point creating the table is we're just displaying a confirmation screen.
if (empty($resetconfirmation)) {
$webservice->generate_user_ws_tokens($USER->id);
// Generate all token that need to be generated.
$tokens = $webservice->get_user_ws_tokens($USER->id);
foreach ($tokens as $token) {
if ($token->restrictedusers) {
$authlist = $webservice->get_ws_authorised_user($token->wsid, $USER->id);
if (empty($authlist)) {
$token->enabled = false;
}
}
}
$webservicetokenboxhtml = $wsrenderer->user_webservice_tokens_box($tokens, $USER->id, $CFG->enablewsdocumentation);
// Display the box for web service token.
}
}
// RSS keys.
if (!empty($CFG->enablerssfeeds)) {
require_once $CFG->dirroot . '/lib/rsslib.php';