当前位置: 首页>>代码示例>>PHP>>正文


PHP webservice::get_ws_authorised_users方法代码示例

本文整理汇总了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();
开发者ID:vuchannguyen,项目名称:web,代码行数:31,代码来源:service_users.php


注:本文中的webservice::get_ws_authorised_users方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。