]> git.mjollnir.org Git - moodle.git/commitdiff
Use table prefixes on database too :-)
authormoodler <moodler>
Tue, 24 Dec 2002 10:07:45 +0000 (10:07 +0000)
committermoodler <moodler>
Tue, 24 Dec 2002 10:07:45 +0000 (10:07 +0000)
lib/moodlelib.php

index ac56f575f3791c63d344f6d7e4a44f5c14e84683..c646e795de28504d39e38ba6cf20e1f30503b30c 100644 (file)
@@ -418,19 +418,27 @@ function isediting($courseid, $user=NULL) {
 
 function set_moodle_cookie($thing) {
 /// Sets a moodle cookie with an encrypted string
+    global $CFG;
+
+    $cookiename = "MOODLEID{$CFG->prefix}";
 
     $days = 60;
     $seconds = 60*60*24*$days;
 
-    setCookie ('MOODLEID', "", time() - 3600, "/");
-    setCookie ('MOODLEID', rc4encrypt($thing), time()+$seconds, "/");
+    setCookie($cookiename, "", time() - 3600, "/");
+    setCookie($cookiename, rc4encrypt($thing), time()+$seconds, "/");
 }
 
 
 function get_moodle_cookie() {
 /// Gets a moodle cookie with an encrypted string
-    global $MOODLEID;
-    return rc4decrypt($MOODLEID);
+    global $CFG;
+
+    $cookiename = "MOODLEID{$CFG->prefix}";
+
+    global $$cookiename;
+
+    return rc4decrypt($$cookiename);
 }