]> git.mjollnir.org Git - moodle.git/commitdiff
mnet: it is $USER->mnet_foreign_host_array instead of $SESSION->mnet_foreign_host_arr...
authormartinlanghoff <martinlanghoff>
Fri, 19 Jan 2007 08:36:02 +0000 (08:36 +0000)
committermartinlanghoff <martinlanghoff>
Fri, 19 Jan 2007 08:36:02 +0000 (08:36 +0000)
auth/mnet/auth.php
auth/mnet/land.php
blocks/course_list/block_course_list.php

index a862cda2f7a8733c217415199b8ead22f239cb91..9bb79b6727d8c15a08a3a53755e4118c58359ccf 100644 (file)
@@ -343,14 +343,16 @@ class auth_plugin_mnet
             }
 
             if($key == 'myhosts') {
-                $SESSION->mnet_foreign_host_array = array();
+                $localuser->mnet_foreign_host_array = array();
                 foreach($val as $somecourse) {
                     $name  = clean_param($somecourse['name'], PARAM_ALPHANUM);
                     $url   = clean_param($somecourse['url'], PARAM_URL);
                     $count = clean_param($somecourse['count'], PARAM_INT);
                     $url_is_local = stristr($url , $CFG->wwwroot);
                     if (!empty($name) && !empty($count) && empty($url_is_local)) {
-                        $SESSION->mnet_foreign_host_array[] = array('name' => $name, 'url' => $url, 'count' => $count);
+                        $localuser->mnet_foreign_host_array[] = array('name'  => $name, 
+                                                                      'url'   => $url, 
+                                                                      'count' => $count);
                     }
                 }
             }
index 4c58f2e3300c26884fc3e301be8a4050cffa30c0..e03f4a96c9d9b54822e30595be6b244e95baba86 100644 (file)
@@ -33,6 +33,10 @@ $CFG->auth = 'mnet';
 $USER = get_complete_user_data('id', $localuser->id, $localuser->mnethostid);
 load_all_capabilities();
 
+if (!empty($localuser->mnet_foreign_host_array)) {
+    $USER->mnet_foreign_host_array = $localuser->mnet_foreign_host_array;
+}
+
 // redirect
 redirect($CFG->wwwroot . $wantsurl);
 
index 4e802e0deb55632a04d7dd1acfbaa94920ba94bf..3b71c692a81deaa0aa267b320afae595715167ed 100644 (file)
@@ -102,7 +102,7 @@ class block_course_list extends block_list {
     }
 
     function get_remote_courses() {
-        global $THEME, $CFG, $USER, $SESSION;
+        global $THEME, $CFG, $USER;
         $icon  = '<img src="'.$CFG->pixpath.'/i/mnethost.gif" class="icon" alt="'.get_string('course').'" />';
 
         // only for logged in users!
@@ -111,10 +111,10 @@ class block_course_list extends block_list {
         }
 
         if ($USER->mnethostid != $CFG->mnet_localhost_id) {
-            if (!empty($SESSION->mnet_foreign_host_array) && is_array($SESSION->mnet_foreign_host_array)) {
+            if (!empty($USER->mnet_foreign_host_array) && is_array($USER->mnet_foreign_host_array)) {
                 $this->content->items[] = get_string('remotemoodles','mnet'); 
                 $this->content->icons[] = '';
-                foreach($SESSION->mnet_foreign_host_array as $somehost) {
+                foreach($USER->mnet_foreign_host_array as $somehost) {
                     $this->content->items[] = $somehost['count'].get_string('courseson','mnet').'<a title="'.$somehost['name'].'" href="'.$somehost['url'].'">'.$somehost['name'].'</a>';
                     $this->content->icons[] = $icon;
                 }