portfolio/mnet/mahara MDL-15362 perform better mnet session handling

This commit is contained in:
Penny Leach 2010-03-21 17:20:36 +00:00
parent 3aa1d76573
commit 14e23787c0

View File

@ -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() {