mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Even safer implementation of the temporary $USER variable
This commit is contained in:
parent
b346b424d6
commit
10c6c6063b
@ -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";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user