Moodle URL not added to page access email

Bug #1221708 reported by Luke Stirk
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned

Bug Description

We have a Mahara site connected to Moodle. On all emails received so far the URLs have the Moodle URL and then the Mahara URL as the destination eg:

https://moodleurl.com/auth/mnet/jump.php?hostwwwroot=https://maharaurl.com&wantsurl=user%2Fview.php%3Fid%3D9

But this is not happening when sharing your page with users. The URL the user gets is just the standard Mahara URL which then takes them to a login page but the users do not have a login for Mahara only for the Moodle. Can the URL in this email be changed so behave in the same way as others such as Friend request and Group invite?

Thanks

Luke Stirk (luke-stirk)
description: updated
Revision history for this message
Aaron Wells (u-aaronw) wrote :

It appears that what's causing this bug is the following:

1. In email_user(), we do a find/replace of all URLs for the MNet URL

2. BUT, we only do this if the $user passed in to the function has a flag set that indicates that they are on MNet

3. Most Activity types use the function activity_get_users() to get the list of users who should receive the activity. This function populates the MNet flags for each user.

4. But the ActivityTypeNewview, which is what sends out "shared view" notifications, instead uses the function activity_get_viewaccess_users(), which doesn't populate the MNet flags.

So the solution is to populate the MNet flags for the users generated by activity_get_viewaccess_users()

Changed in mahara:
status: New → Confirmed
importance: Undecided → Medium
tags: added: activities email mnet notifications
Revision history for this message
Luke Stirk (luke-stirk) wrote :

Is there likely to be a fix any time soon?

Thanks

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Did you set the config value for externallogin?

You can set a config value to redirect you to the Moodle login page. See htdocs/lib/config-defaults.php and search for "externallogin" to get to the part where this feature is discussed.

This should allow all regular URLs to be redirected to the proper login page (and then back).

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Hi Luke,

I've identified the general outlines of the fix we need in my previous comment, but the Mahara developers in my office are pretty booked up right now, so we will probably not have the time to implement a fix immediately. It could happen faster if a member of the community outside of our organization decides to fix it.

In the meantime, using the externallogin feature that Kristina described, should be a pretty good workaround.

Cheers,
Aaron

Revision history for this message
Luke Stirk (luke-stirk) wrote :

Hi,

Thanks for the replies. The config value sounds good however we have 2 separate Moodles accessing one Mahara so the URL really needs to be pulled through from the institution.

Revision history for this message
Andreas Schenkel (andreas-schenkel) wrote :

Is there a bugfix for this problem?

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/7253

Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi,

I've taken what Aaron mentioned back in 2013 and created a patch based on his idea.

The patch is here https://reviews.mahara.org/#/c/7253/

I've not been able to fully test it yet so if others want to test it and let me know if it works or not that would be good

Robert

Changed in mahara:
milestone: none → 17.04.0
status: Confirmed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/7253
Committed: https://git.mahara.org/mahara/mahara/commit/60473009d04b4cf09afe826e773a28b54832a527
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 60473009d04b4cf09afe826e773a28b54832a527
Author: Robert Lyon <email address hidden>
Date: Tue Nov 15 09:40:05 2016 +1300

Bug 1221708: Adding mnethostwwwroot and mnethostapp values to results

For the activity_get_viewaccess_users() function to make it similar to
activity_get_users() so that we can have the correct remote url in the
email message.

behatnotneeded

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

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
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.