Skip to content

Commit

Permalink
MDL-9399 auth/ldap: NTLM redirect only on initial GET
Browse files Browse the repository at this point in the history
We only want to redirect when users are being shown the login page (on
GET) but not when users are POSTing to it, actually trying to login.
  • Loading branch information
martinlanghoff committed Nov 14, 2007
1 parent 02c7f3d commit 0a1c2f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion auth/ldap/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -1745,7 +1745,9 @@ function change_password_url() {
function loginpage_hook() {
global $CFG;

if (!empty($this->config->ntlmsso_enabled) // SSO enabled
if ($_SERVER['REQUEST_METHOD'] === 'GET' // Only on initial GET
// of loginpage
&&!empty($this->config->ntlmsso_enabled)// SSO enabled
&& !empty($this->config->ntlmsso_subnet)// have a subnet to test for
&& empty($_GET['authldap_skipntlmsso']) // haven't failed it yet
&& (isguestuser() || !isloggedin()) // guestuser or not-logged-in users
Expand Down

0 comments on commit 0a1c2f4

Please sign in to comment.