本文整理汇总了PHP中webservice::get_ws_authorised_users方法的典型用法代码示例。如果您正苦于以下问题:PHP webservice::get_ws_authorised_users方法的具体用法?PHP webservice::get_ws_authorised_users怎么用?PHP webservice::get_ws_authorised_users使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webservice
的用法示例。
在下文中一共展示了webservice::get_ws_authorised_users方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: stdClass
$potentialuserselector->invalidate_selected_users();
$alloweduserselector->invalidate_selected_users();
}
}
/// Print the form.
/// display the UI
$renderer = $PAGE->get_renderer('core', 'webservice');
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('selectauthorisedusers', 'webservice'), 3, 'main');
$selectoroptions = new stdClass();
$selectoroptions->serviceid = $id;
$selectoroptions->alloweduserselector = $alloweduserselector;
$selectoroptions->potentialuserselector = $potentialuserselector;
echo $renderer->admin_authorised_user_selector($selectoroptions);
/// get the missing capabilities for all users (will be displayed into the renderer)
$allowedusers = $webservicemanager->get_ws_authorised_users($id);
$usersmissingcaps = $webservicemanager->get_missing_capabilities_by_users($allowedusers, $id);
//add the missing capabilities to the allowed users object to be displayed by renderer
foreach ($allowedusers as &$alloweduser) {
if (!is_siteadmin($alloweduser->id) and key_exists($alloweduser->id, $usersmissingcaps)) {
$alloweduser->missingcapabilities = implode(',', $usersmissingcaps[$alloweduser->id]);
}
}
/// display the list of allowed users with their options (ip/timecreated / validuntil...)
//check that the user has the service required capability (if needed)
if (!empty($allowedusers)) {
$renderer = $PAGE->get_renderer('core', 'webservice');
echo $OUTPUT->heading(get_string('serviceuserssettings', 'webservice'), 3, 'main');
echo $renderer->admin_authorised_user_list($allowedusers, $id);
}
echo $OUTPUT->footer();