Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-41733 auth_cas: Allow direct authentication with CAS to a course …

…when multiple authentication is activated
  • Loading branch information...
commit adbf94c95725c24b5b93afc8d3bc24fc057c6a17 1 parent 83f26f6
@leblangi leblangi authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 auth/cas/auth.php
View
7 auth/cas/auth.php
@@ -96,6 +96,7 @@ function loginpage_hook() {
$site = get_site();
$CASform = get_string('CASform', 'auth_cas');
$username = optional_param('username', '', PARAM_RAW);
+ $courseid = optional_param('courseid', 0, PARAM_INT);
if (!empty($username)) {
if (isset($SESSION->wantsurl) && (strstr($SESSION->wantsurl, 'ticket') ||
@@ -117,6 +118,12 @@ function loginpage_hook() {
$frm = new stdClass();
$frm->username = phpCAS::getUser();
$frm->password = 'passwdCas';
+
+ // Redirect to a course if multi-auth is activated, authCAS is set to CAS and the courseid is specified.
+ if ($this->config->multiauth && !empty($courseid)) {
+ redirect(new moodle_url('/course/view.php', array('id'=>$courseid)));
+ }
+
return;
}
Please sign in to comment.
Something went wrong with that request. Please try again.