]> git.mjollnir.org Git - moodle.git/commitdiff
Mnet: We haven't been updating the last_connect_time field. Let's do that.
authordonal72 <donal72>
Wed, 24 Jan 2007 23:17:08 +0000 (23:17 +0000)
committerdonal72 <donal72>
Wed, 24 Jan 2007 23:17:08 +0000 (23:17 +0000)
mnet/peer.php
mnet/xmlrpc/client.php
mnet/xmlrpc/server.php

index 4ee56545aeb1d8b24365a9a997648d50517ded78..2e1c64cc5058c11ab6a42187e14bf18230f32eb1 100644 (file)
@@ -165,6 +165,11 @@ class mnet_peer {
         }
     }
 
+    function touch() {
+        $this->last_connect_time = time();
+        $this->commit();
+    }
+
     function set_name($newname) {
         if (is_string($newname) && strlen($newname <= 80)) {
             $this->name = $newname;
index f65a683fd25c66065acbc8e9a9bca7b968aa6fc3..e765762b02f83d6bce79076089a2885351b73b12 100644 (file)
@@ -196,6 +196,8 @@ class mnet_xmlrpc_client {
             return false;
         }
 
+        $mnet_peer->touch();
+
         $crypt_parser = new mnet_encxml_parser();
         $crypt_parser->parse($this->rawresponse);
 
index 9acc80fda6e8d3f1547b66b8f0b00a5f1bf15b0b..2682ec8eb19c475cb6eee8a7796e3025390b4f4e 100644 (file)
@@ -202,6 +202,7 @@ function mnet_server_strip_wrappers($HTTP_RAW_POST_DATA) {
         // Does the signature match the data and the public cert?
         $signature_verified = openssl_verify($payload, base64_decode($sig_parser->signature), $certificate);
         if ($signature_verified == 1) {
+            $MNET_REMOTE_CLIENT->touch();
             // Parse the XML
         } elseif ($signature_verified == 0) {
             $currkey = mnet_get_public_key($MNET_REMOTE_CLIENT->wwwroot);