Skip to content

Commit

Permalink
portfolio/mnet/mahara MDL-15362 perform better mnet session handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Penny Leach committed Mar 21, 2010
1 parent 3aa1d76 commit 14e2378
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions portfolio/mahara/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,20 +236,10 @@ public function get_static_continue_url() {
}

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() {
Expand Down

0 comments on commit 14e2378

Please sign in to comment.