From 7b4e04932dbad20bab6c86704269176afa74e1db Mon Sep 17 00:00:00 2001
From: Melissa Draper <melissa@catalyst.net.nz>
Date: Tue, 27 Nov 2012 12:11:27 +1300
Subject: [PATCH] Fix for moodle->mahara mnet jumping in Firefox 17
 (MDL-36838)

When jumping with mnet from moodle to mahara, the useragent used
to search for the session will be wrong. This is because Firefox
17 (and potentially later) overrides the useragent of Moodle sites
and not Mahara or other sites.

Removing the useragent hash from the database query mitigates the
mismatch.
---
 auth/mnet/auth.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/auth/mnet/auth.php b/auth/mnet/auth.php
index f6938f3..6ec9b88 100644
--- a/auth/mnet/auth.php
+++ b/auth/mnet/auth.php
@@ -57,7 +57,7 @@ class auth_plugin_mnet extends auth_plugin_base {
         $remoteclient = get_mnet_remote_client();
         require_once $CFG->dirroot . '/mnet/xmlrpc/serverlib.php';
 
-        $mnet_session = $DB->get_record('mnet_session', array('token'=>$token, 'useragent'=>$useragent));
+        $mnet_session = $DB->get_record('mnet_session', array('token'=>$token));
         if (empty($mnet_session)) {
             throw new mnet_server_exception(1, 'authfail_nosessionexists');
         }
-- 
1.8.0

