本文整理汇总了PHP中webservice::update_ws_authorised_user方法的典型用法代码示例。如果您正苦于以下问题:PHP webservice::update_ws_authorised_user方法的具体用法?PHP webservice::update_ws_authorised_user怎么用?PHP webservice::update_ws_authorised_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webservice
的用法示例。
在下文中一共展示了webservice::update_ws_authorised_user方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$PAGE->navbar->add(get_string('serviceusers', 'webservice'), new moodle_url('/' . $CFG->admin . '/webservice/service_users.php', array('id' => $serviceid)));
$PAGE->navbar->add(get_string('serviceusersettings', 'webservice'));
$formaction = new moodle_url('', array('id' => $serviceid, 'userid' => $userid));
$returnurl = new moodle_url('/' . $CFG->admin . '/webservice/service_users.php', array('id' => $serviceid));
$webservicemanager = new webservice();
$serviceuser = $webservicemanager->get_ws_authorised_user($serviceid, $userid);
$usersettingsform = new external_service_authorised_user_settings_form($formaction, $serviceuser);
$settingsformdata = $usersettingsform->get_data();
if ($usersettingsform->is_cancelled()) {
redirect($returnurl);
} else {
if (!empty($settingsformdata) and confirm_sesskey()) {
/// save user settings (administrator clicked on update button)
$settingsformdata = (object) $settingsformdata;
$serviceuserinfo = new stdClass();
$serviceuserinfo->id = $serviceuser->serviceuserid;
$serviceuserinfo->iprestriction = $settingsformdata->iprestriction;
$serviceuserinfo->validuntil = $settingsformdata->validuntil;
$webservicemanager->update_ws_authorised_user($serviceuserinfo);
//TODO: assign capability
//display successful notification
$notification = $OUTPUT->notification(get_string('usersettingssaved', 'webservice'), 'success');
}
}
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('serviceusersettings', 'webservice'), 3, 'main');
if (!empty($notification)) {
echo $notification;
}
$usersettingsform->display();
echo $OUTPUT->footer();