本文整理汇总了PHP中mnet_peer::set_name方法的典型用法代码示例。如果您正苦于以下问题:PHP mnet_peer::set_name方法的具体用法?PHP mnet_peer::set_name怎么用?PHP mnet_peer::set_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mnet_peer
的用法示例。
在下文中一共展示了mnet_peer::set_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
} else {
// PARAM_URL requires a genuine TLD (I think) This breaks my testing
$temp_wwwroot = clean_param($form->wwwroot, PARAM_URL);
if ($temp_wwwroot !== $form->wwwroot) {
trigger_error("We now parse the wwwroot with PARAM_URL. Your URL will need to have a valid TLD, etc.");
print_error('invalidurl', 'mnet', 'peers.php');
exit;
}
unset($temp_wwwroot);
$mnet_peer->set_applicationid($form->applicationid);
$application = $DB->get_field('mnet_application', 'name', array('id' => $form->applicationid));
$mnet_peer->bootstrap($form->wwwroot, null, $application);
}
if (isset($form->name) && $form->name != $mnet_peer->name) {
$form->name = clean_param($form->name, PARAM_NOTAGS);
$mnet_peer->set_name($form->name);
}
if (isset($form->deleted) && ($form->deleted == '0' || $form->deleted == '1')) {
$mnet_peer->deleted = $form->deleted;
}
if (isset($form->public_key)) {
$form->public_key = clean_param($form->public_key, PARAM_PEM);
if (empty($form->public_key)) {
print_error("invalidpubkey", 'mnet', 'peers.php?step=update&hostid=' . $mnet_peer->id, '');
exit;
} else {
$oldkey = $mnet_peer->public_key;
$mnet_peer->public_key = $form->public_key;
$credentials = $mnet_peer->check_credentials($form->public_key);
$mnet_peer->public_key_expires = $credentials['validTo_time_t'];
if ($mnet_peer->public_key_expires == false) {
示例2: fread
$maharawebroot = fread($fh, filesize($mfile));
fclose($fh);
if (empty($maharawebroot)) {
error('Step3 - could not find maharawebroot. Config failed.');
}
$strheader = get_string('mahoodle', 'configmahoodle');
$navlinks = array();
$navlinks[] = array('name' => $strheader, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header($strheader, $strheader, $navigation, "");
//now set up pubkey stuff in Moodle
$mnet_peer = new mnet_peer();
$application = get_record('mnet_application', 'name', 'mahara');
$mnet_peer->set_applicationid($application->id);
$mnet_peer->bootstrap($maharawebroot, null, $application->name);
$mnet_peer->set_name('localmahara');
$mnet_peer->commit();
//now configure Networking in Moodle.
//first get hostid.
$hostid = get_field('mnet_host', 'id', 'name', 'localmahara');
$host2service = new stdClass();
$host2service->hostid = $hostid;
$host2service->serviceid = get_field('mnet_service', 'id', 'name', 'sso_idp');
$host2service->publish = 1;
$host2service->subscribe = 0;
if ($hostrec = get_record('mnet_host2service', 'hostid', $hostid, 'serviceid', $host2service->serviceid)) {
$host2service->id = $hostrec->id;
update_record('mnet_host2service', $host2service);
} else {
insert_record('mnet_host2service', $host2service);
}