Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent redirects when not logged into moodle #17

Open
kaseyhackspace opened this issue Jul 25, 2023 · 6 comments
Open

prevent redirects when not logged into moodle #17

kaseyhackspace opened this issue Jul 25, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@kaseyhackspace
Copy link

It would be good if the plugin prevents redirects if the user is not logged into moodle. The current behavior is that custom redirects are still applied even if you access the "redirect from" link in incognito where a user is not logged in.

@brendanheywood
Copy link
Contributor

thanks @kaseyhackspace

Can you give an example use case for why you'd want that? If you added a redirect using say apache or nginx you typically don't care about the user at all its just a blanket redirect.

@brendanheywood brendanheywood added the enhancement New feature or request label Jul 25, 2023
@kaseyhackspace
Copy link
Author

Hi @brendanheywood , thanks for responding. We're mass redirecting a lot of /mod/page/view.php?id=<id> URLs on one of our courses with where the student needs to be enrolled in to access the resource. The default behavior when you visit /mod/page/view.php?id=<id> and you are not logged in is you are redirected to the moodle login page. We would still want this in place so students don't go sharing the links publicly :)

@brendanheywood
Copy link
Contributor

Just had another client ask for something similar to this but the exact opposite.

I'm gonna propose we add a flag syntax which we can reuse for other features, vaguely inspired by the apache syntax:

#^/target#=>/destination
#^/target#=>/destination [anon]
#^/target#=>/destination [auth]
#^/target#=>/destination [auth=manual]

The alternative is we ditch specifying redirects as a text area and move to editing each one as a record with a form and these could be tick boxes.

@kaseyhackspace
Copy link
Author

Hi @brendanheywood , I vote for the flag syntax on the text area. Reason is due to the number of redirects we have to make, I made a script that generates the redirect rules that I put in the text area. If it was a per record approach, might be harder to maintain hundreds of links by batch?

@brendanheywood
Copy link
Contributor

Yeah textarea certainly makes that easier. We could expose it with a cli / web service to add and remove them pragmatically but its just more work

@kaseyhackspace
Copy link
Author

Yeah the KISS principle applies to this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants