Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

just a hook for weblink authentication

  • Loading branch information...
commit 0e8a3f25e16a3c7ac95e3f645296ffa01b300298 1 parent 3b037ee
fiedorow authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 login/index.php
View
14 login/index.php
@@ -43,10 +43,22 @@
$frm = false;
+ $user = false;
if ((!empty($SESSION->wantsurl) and strstr($SESSION->wantsurl,"username=guest")) or $loginguest) {
/// Log in as guest automatically (idea from Zbigniew Fiedorowicz)
$frm->username = "guest";
$frm->password = "guest";
+ } else if (!empty($SESSION->wantsurl) && file_exists($CFG->dirroot . "/login/weblinkauth.php")) {
+ //Handles the case of another Moodle site linking into a page on this site
+ include $CFG->dirroot . "/login/weblinkauth.php";
+ if (function_exists(weblink_auth)) {
+ $user = weblink_auth($SESSION->wantsurl);
+ }
+ if ($user) {
+ $frm->username = $user->username;
+ } else {
+ $frm = data_submitted();
+ }
} else {
$frm = data_submitted();
}
@@ -62,7 +74,7 @@
if (($frm->username == 'guest') and empty($CFG->guestloginbutton)) {
$user = false; /// Can't log in as guest if guest button is disabled
$frm = false;
- } else {
+ } else if (!$user) {
$user = authenticate_user_login($frm->username, $frm->password);
}
update_login_count();
Please sign in to comment.
Something went wrong with that request. Please try again.