mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-17027: protect user profile images if $CFG->forcelogin enabled; merged from MOODLE_19_STABLE
This commit is contained in:
parent
25a79c16a1
commit
cb4709dccd
1 changed files with 6 additions and 2 deletions
|
@ -3,11 +3,15 @@
|
||||||
// Syntax: pix.php/userid/f1.jpg or pix.php/userid/f2.jpg
|
// Syntax: pix.php/userid/f1.jpg or pix.php/userid/f2.jpg
|
||||||
// OR: ?file=userid/f1.jpg or ?file=userid/f2.jpg
|
// OR: ?file=userid/f1.jpg or ?file=userid/f2.jpg
|
||||||
|
|
||||||
define('NO_MOODLE_COOKIES', true); // session not used here
|
|
||||||
|
|
||||||
require_once('../config.php');
|
require_once('../config.php');
|
||||||
require_once($CFG->libdir.'/filelib.php');
|
require_once($CFG->libdir.'/filelib.php');
|
||||||
|
|
||||||
|
if (!empty($CFG->forcelogin) and !isloggedin()) {
|
||||||
|
// protect images if login required and not logged in;
|
||||||
|
// do not use require_login() because it is expensive and not suitable here anyway
|
||||||
|
redirect($CFG->pixpath.'/u/f1.png');
|
||||||
|
}
|
||||||
|
|
||||||
// disable moodle specific debug messages
|
// disable moodle specific debug messages
|
||||||
disable_debugging();
|
disable_debugging();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue