Little tweak to fix a caching problem.
User images were not being cached properly because Moodle was sending a session cookie. I've turned this off now for user images.
This commit is contained in:
+12
-10
@@ -162,17 +162,19 @@
|
||||
|
||||
class object {};
|
||||
|
||||
session_name('MoodleSession');
|
||||
@session_start();
|
||||
if (! isset($_SESSION['SESSION'])) {
|
||||
$_SESSION['SESSION'] = new object;
|
||||
if (!isset($nomoodlecookie)) {
|
||||
session_name('MoodleSession');
|
||||
@session_start();
|
||||
if (! isset($_SESSION['SESSION'])) {
|
||||
$_SESSION['SESSION'] = new object;
|
||||
}
|
||||
if (! isset($_SESSION['USER'])) {
|
||||
$_SESSION['USER'] = new object;
|
||||
}
|
||||
|
||||
$SESSION = &$_SESSION['SESSION']; // Makes them easier to reference
|
||||
$USER = &$_SESSION['USER'];
|
||||
}
|
||||
if (! isset($_SESSION['USER'])) {
|
||||
$_SESSION['USER'] = new object;
|
||||
}
|
||||
|
||||
$SESSION = &$_SESSION['SESSION']; // Makes them easier to reference
|
||||
$USER = &$_SESSION['USER'];
|
||||
|
||||
if (isset($FULLME)) {
|
||||
$ME = $FULLME;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// Syntax: pix.php/userid/f1.jpg or pix.php/userid/f2.jpg
|
||||
// OR: ?file=userid/f1.jpg or ?file=userid/f2.jpg
|
||||
|
||||
$nomoodlecookie = true; // Because it interferes with caching
|
||||
|
||||
require_once("../config.php");
|
||||
|
||||
$lifetime = 86400;
|
||||
|
||||
Reference in New Issue
Block a user