General developer forum

require login for site *but* allow some course files to be viewed

 
Picture of Greg Holmes
require login for site *but* allow some course files to be viewed
 

I think I posted in the wrong forum (themes) initially for my question, so here's the link to the post to avoid completely just cross-posting this ... 

https://moodle.org/mod/forum/discuss.php?d=369091

Our custom theme is trying to display a course image to the visitor on the login page. As it is now, the image won't load since the visitor is not logged in. Basically, if the course allows guest access, we want to allow any visitor to see the course overview files, despite "force users to login" being set.  

Trying to figure out the best strategy for getting around this - presumably I need to override some function in the chain that loads the image (via pluginfile.php) - but I am getting lost in the weeds. Any thoughts on how to handle this?

 
Average of ratings: -