From: moodler Date: Tue, 24 Dec 2002 10:07:45 +0000 (+0000) Subject: Use table prefixes on database too :-) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7185e073edc2a1411ffc5878e10c62bb956c3002;p=moodle.git Use table prefixes on database too :-) --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index ac56f575f3..c646e795de 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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); }