Even safer implementation of the temporary $USER variable

This commit is contained in:
moodler 2004-03-22 16:39:40 +00:00
parent b346b424d6
commit 10c6c6063b

View File

@ -18,6 +18,10 @@
require_once("../config.php");
if (!$alreadyadmin = isadmin()) {
unset($_SESSION['USER']);
unset($USER);
unset($_SESSION['SESSION']);
unset($SESSION);
$USER = get_admin(); /// Temporarily, to provide environment for this script
}
@ -135,11 +139,6 @@
echo "Cron script completed correctly\n";
if (!$alreadyadmin) {
$SESSION = NULL;
$USER = NULL;
}
$difftime = microtime_diff($starttime, microtime());
echo "Execution took ".$difftime." seconds\n";