Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

hook for redirecting to externally hosted courses

  • Loading branch information...
commit 542a04353b9e97852f842b1e9e737e16fcbd6acd 1 parent b7dd445
fiedorow authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 course/view.php
View
11 course/view.php
@@ -32,6 +32,17 @@
require_login($course->id);
+ //If course is hosted on an external server, redirect to corresponding
+ //url with appropriate authentication attached as parameter
+ if (file_exists($CFG->dirroot ."/course/externservercourse.php")) {
+ include $CFG->dirroot ."/course/externservercourse.php";
+ if (function_exists(extern_server_course)) {
+ if ($extern_url = extern_server_course($course)) {
+ redirect($extern_url);
+ }
+ }
+ }
+
require_once($CFG->dirroot.'/calendar/lib.php'); /// This is after login because it needs $USER
add_to_log($course->id, "course", "view", "view.php?id=$course->id", "$course->id");
Please sign in to comment.
Something went wrong with that request. Please try again.