Permalink
Browse files

Even safer implementation of the temporary $USER variable

  • Loading branch information...
1 parent b346b42 commit 10c6c6063b4d06488d9f7f05704b55910b93804d moodler committed Mar 22, 2004
Showing with 4 additions and 5 deletions.
  1. +4 −5 admin/cron.php
View
@@ -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";

0 comments on commit 10c6c60

Please sign in to comment.