本文整理汇总了PHP中mnet_peer::check_credentials方法的典型用法代码示例。如果您正苦于以下问题:PHP mnet_peer::check_credentials方法的具体用法?PHP mnet_peer::check_credentials怎么用?PHP mnet_peer::check_credentials使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mnet_peer
的用法示例。
在下文中一共展示了mnet_peer::check_credentials方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
redirect('peers.php?step=update&hostid=' . $mnet_peer->id, get_string('changessaved'));
} else {
print_error('invalidaction', 'error', 'index.php');
}
}
}
} elseif (is_int($hostid)) {
$mnet_peer = new mnet_peer();
$mnet_peer->set_id($hostid);
$currentkey = mnet_get_public_key($mnet_peer->wwwroot, $mnet_peer->application);
if ($currentkey == $mnet_peer->public_key) {
unset($currentkey);
}
$form = new stdClass();
if ($hostid != $CFG->mnet_all_hosts_id) {
$credentials = $mnet_peer->check_credentials($mnet_peer->public_key);
include './mnet_review.html';
} else {
include './mnet_review_allhosts.html';
}
} else {
$hosts = $DB->get_records_sql(' SELECT
h.id,
h.wwwroot,
h.ip_address,
h.name,
h.public_key,
h.public_key_expires,
h.transport,
h.portno,
h.last_connect_time,
示例2: validation
function validation($data, $files)
{
$errors = array();
if ($data['oldpublickey'] == $data['public_key']) {
return;
}
$mnet_peer = new mnet_peer();
// idiotic api
$mnet_peer->wwwroot = $data['wwwroot'];
// just hard-set this rather than bootstrap the object
if (empty($data['public_key'])) {
$errors['public_key'] = get_string('publickeyrequired', 'mnet');
} else {
if (!($credentials = $mnet_peer->check_credentials($data['public_key']))) {
$errmsg = '';
foreach ($mnet_peer->error as $err) {
$errmsg .= $err['code'] . ': ' . $err['text'] . '<br />';
}
$errors['public_key'] = get_string('invalidpubkey', 'mnet', $errmsg);
}
}
unset($mnet_peer);
return $errors;
}