From 14e23787c0f5466346ac09b2f1dabecfd3cf63b3 Mon Sep 17 00:00:00 2001 From: Penny Leach Date: Sun, 21 Mar 2010 17:20:36 +0000 Subject: [PATCH] portfolio/mnet/mahara MDL-15362 perform better mnet session handling --- portfolio/mahara/lib.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/portfolio/mahara/lib.php b/portfolio/mahara/lib.php index a1b4b003af0..77fb1d0a501 100644 --- a/portfolio/mahara/lib.php +++ b/portfolio/mahara/lib.php @@ -236,20 +236,10 @@ class portfolio_plugin_mahara extends portfolio_plugin_pull_base { } public function resolve_static_continue_url($remoteurl) { - static $sessions = array(); - // if this is called mutliple times for the same host, stuff breaks - // so we have to keep track and just replace the wantsurl bit - // in case things go to different plugins or whatever - if (array_key_exists($this->get_config('mnethostid'), $sessions)) { - return preg_replace('/wantsurl=[^&]*&/', 'wantsurl=' . urlencode($remoteurl) . '&', $sessions[$this->get_config('mnethostid')]); - } + global $CFG; $this->ensure_mnethost(); - $mnetauth = get_auth_plugin('mnet'); - if (!$url = $mnetauth->start_jump_session($this->get_config('mnethostid'), $remoteurl)) { - return false; - } - $sessions[$this->get_config('mnethostid')] = $url; - return $url; + $u = new moodle_url('/auth/mnet/jump.php', array('hostid' => $this->get_config('mnethostid'), 'wantsurl' => $remoteurl)); + return $u->out(); } public function get_interactive_continue_url() {