moodle login generates image download

moodle login generates image download

by Jeff Stanford -
Number of replies: 2

Hi all

We have a problem I've not come across before. We have a new installation of moodle (3.10) on https://moodle.versatile.pub/login/index.php 

If you logon as a guest, sometimes it downloads an image of a book cover, sometimes you get 'invalid logon, please try again', and sometimes it actually works! The images that download both come from the Random Glossary which shows on the Front Page. The Random Glossary is based in one of the courses on the moodle. If I hide the glossary in its home course, the problem disappears. Trouble is, we'd like the random glossary on the front page.  

Has anyone else had this problem and found a reason/solution?

Many thanks

Jeff  

Average of ratings: -
In reply to Jeff Stanford

Re: moodle login generates image download

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

The glossary entries contain an image which is a course resource thus only available to logged in users. When browser tries to get the image it gets a 303 See Other response when the user isn't logged in and a server-side variable, wantsurl, is set to the image's URL. Then when the user (or guest) logs in Moodle sees wantsurl and sends the browser there, so they see the image.

This may not make sense, but consider if a not-logged-in user tried to access a course activity directly. They'd be redirected to the login page with wantsurl set to the activity. Then when they login the user is taken to wantsurl, the activity they were trying to access.

I think this is just how Moodle works, in which case you can't use the Random Glossary Entry Block on the front page if it contains media. Maybe someone can come up with another way to achieve this.

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: moodle login generates image download

by Jeff Stanford -

Hi Leon

Many thanks for your quick and helpful answer. It's good to know why something isn't working, even if we can't fix it!

Jeff