Only check pre-login hook if the auth method is active

Bug #1904636 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned
21.04
Fix Released
Medium
Unassigned
21.10
Fix Released
Medium
Unassigned

Bug Description

Noticed this problem when dealing with a db that had an old auth type in it that didn't exist on local codebase.

When an auth method is inactive we shouldn't need to check it's prelogin hook

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/11458

Robert Lyon (robertl-9)
Changed in mahara:
importance: Undecided → Medium
status: New → In Progress
milestone: none → 21.04.0
Changed in mahara:
milestone: 21.04.0 → 21.04.1
Revision history for this message
Robert Lyon (robertl-9) wrote :

Steps to test:

1) Add an auth instance, like ldap, to 'mahara' institution then log out

2) Go to the database and add a new fake auth, called 'cheese', which we will have as not active - this is to simulate the scenario where an auth method did exist (like 'browserid') but was removed.

 INSERT INTO auth_installed VALUES ('cheese', '2001010100', '0.5', 0, 0, 0);

3) Update the auth instance for the step 1 and have it use the false auth method and be not active, eg

 UPDATE auth_instance SET authname = 'cheese', active = 0 WHERE authname = 'ldap';

4) Go to logged out homepage

Before patch - see error: ".../htdocs/auth/cheese/lib.php did not exist" and can't login

After patch - no error and can login

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11458
Committed: https://git.mahara.org/mahara/mahara/commit/2f70c9ae4511519f28c4fbb58712031aa17342ad
Submitter: Lisa Seeto (<email address hidden>)
Branch: master

commit 2f70c9ae4511519f28c4fbb58712031aa17342ad
Author: Robert Lyon <email address hidden>
Date: Wed Nov 18 12:53:08 2020 +1300

Bug 1904636: Only call pre login hook for active auth methods

In case you are trying to use a site where an auth type has been
removed from the files and is inactive in the db you don't want it to
be called in the auth_plugins_call_pre_loginpage_hook() function

Change-Id: Ieaca8159c1004b695b6c4ce7773b6e7aff1a83f8
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "21.04_STABLE" branch: https://reviews.mahara.org/11756

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11756
Committed: https://git.mahara.org/mahara/mahara/commit/e3023208be6873f12be34b522d587c7b5475f056
Submitter: Lisa Seeto (<email address hidden>)
Branch: 21.04_STABLE

commit e3023208be6873f12be34b522d587c7b5475f056
Author: Robert Lyon <email address hidden>
Date: Wed Nov 18 12:53:08 2020 +1300

Bug 1904636: Only call pre login hook for active auth methods

In case you are trying to use a site where an auth type has been
removed from the files and is inactive in the db you don't want it to
be called in the auth_plugins_call_pre_loginpage_hook() function

Change-Id: Ieaca8159c1004b695b6c4ce7773b6e7aff1a83f8
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 2f70c9ae4511519f28c4fbb58712031aa17342ad)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.