本文整理匯總了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;
}