Display a breakdown of certificate credentials information to assist in debugging. MDL-11020, MDL-10326

This commit is contained in:
donal72
2007-10-16 13:30:13 +00:00
parent 77ba581090
commit 4275772978
3 changed files with 23 additions and 1 deletions
+17
View File
@@ -124,6 +124,23 @@ if (isset($mnet_peer->ip_address) && '' != $mnet_peer->ip_address){
<td valign="top"><?php echo $mnet_peer->ip_address; ?></td>
</tr>
<?php
}
if (!empty($credentials)) {
?>
<tr>
<td align="right" valign="top"><?php print_string('certdetails', 'mnet'); ?>:</td>
<td valign="top"><pre style="margin: 0px; border: 0px;"><?php
foreach($credentials['subject'] as $key => $credential) {
if (is_scalar($credential)) {
echo str_pad($key, 16, " ", STR_PAD_LEFT).': '.$credential."\n";
} else {
echo str_pad($key, 16, " ", STR_PAD_LEFT).': '.var_export($credential,1)."\n";
}
}
?></pre>
</td>
</tr>
<?php
}
?>
+5 -1
View File
@@ -103,7 +103,8 @@ if (($form = data_submitted()) && confirm_sesskey()) {
} else {
$oldkey = $mnet_peer->public_key;
$mnet_peer->public_key = $form->public_key;
$mnet_peer->public_key_expires = $mnet_peer->check_common_name($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) {
$mnet_peer->public_key == $oldkey;
$errmsg = '<br />';
@@ -114,6 +115,8 @@ if (($form = data_submitted()) && confirm_sesskey()) {
exit;
}
}
} else {
$credentials = $mnet_peer->check_credentials($mnet_peer->public_key);
}
// PREVENT DUPLICATE RECORDS ///////////////////////////////////////////
@@ -141,6 +144,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
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');
+1
View File
@@ -238,6 +238,7 @@ $string['enrolcourseenrol_desc'] = 'Enrol/unenrol users from this course using M
<em>Other enrolled users</em>';
$string['host'] = 'host';
$string['loginlinkmnetuser'] = '<br/>If you are a Moodle Network remote user and can <a href=\"$a\">confirm your email address here</a>, you can be redirected to your login page.<br />';
$string['certdetails'] = 'Cert Details';
$string['error7020'] = 'This error normally occurs if the remote site has created a record for you with the wrong wwwroot, for example, http://yoursite.com instead of http://www.yoursite.com. You should contact the administrator of the remote site with your wwwroot (as specified in config.php) asking her to update her record for your host.';
$string['error7023'] = 'The remote site has tried to decrypt your message with all the keys it has on record for your site. They have all failed. You might be able to fix this problem by manually re-keying with the remote site. This is unlikely to occur unless you\'ve been out of communication with the remote site for a few months.';