admin-logout.php 606 B

12345678910111213141516171819
  1. <?php
  2. require('include/cvs-auth.inc');
  3. /* allow for timezone differences */
  4. setcookie($user = get_user(), '', time() - (3600*24), '/');
  5. setcookie('PHP-GTK', '', time() - (3600*24), '/');
  6. /* kill any test data */
  7. if (file_exists(DB_DIR."/$user.notes.sqlite")) unlink(DB_DIR."/$user.notes.sqlite");
  8. if (file_exists(DB_DIR."/$user.queue.sqlite")) unlink(DB_DIR."/$user.queue.sqlite");
  9. if (file_exists(DB_DIR."/$user.lastid.txt")) unlink(DB_DIR."/$user.lastid.txt");
  10. $referrer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/';
  11. header("Location: $referrer");
  12. exit;
  13. ?>