]> git.mjollnir.org Git - moodle.git/commitdiff
Display a breakdown of certificate credentials information to assist in debugging...
authordonal72 <donal72>
Tue, 16 Oct 2007 13:30:13 +0000 (13:30 +0000)
committerdonal72 <donal72>
Tue, 16 Oct 2007 13:30:13 +0000 (13:30 +0000)
admin/mnet/mnet_review.html
admin/mnet/peers.php
lang/en_utf8/mnet.php

index 31fdcad9d70c6102dd1a1f4602801210954aa52b..1243b097cc008b4c7dc50db8875e62b4526c14bd 100644 (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
 }
 ?>
index 7b50363a517a0f8a41cf7ee6c53bd748e1ae8ecc..dcb35ee6f716bcafa4fb9115b8a49b74417240dd 100644 (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');
index dda04558def05571e16a2f0024b37f9070692ee1..57e01289c05cd16743230b181ba839b1bc49f6af 100644 (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.';