index.php 877 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. ini_set('display_errors', 1);
  3. ini_set("log_errors", 1);
  4. include "../settings.php";
  5. include "../include/init.php";
  6. include "../include/functions.php";
  7. $cdata = parse_url($setting['url']);
  8. $ncookie = array();
  9. $ntoken = array();
  10. $ncookie['index'] = 0;
  11. $c = 0;
  12. foreach ($cookie as $key => $elem){
  13. if(!isset($elem['acct'])){
  14. continue;
  15. }
  16. if ($key == $cookie['index']){
  17. continue;
  18. }
  19. $ncookie[$c] = $elem;
  20. $c++;
  21. }
  22. setrawcookie("user_settings",base64_encode(json_encode($ncookie)),time()+60*60*24*30,'/');
  23. $c = 0;
  24. $tokens = json_decode(base64_decode($_COOKIE['token']),true);
  25. for ($i=0;$i<=(count($tokens)-1);$i++){
  26. if ($i == $cookie['index']){
  27. continue;
  28. }
  29. $ntoken[$c] = $tokens[$i];
  30. $c++;
  31. }
  32. setcookie('token', base64_encode(json_encode($ntoken)), time() + 60 * 60 * 24 * 30, $cdata['path'], $cdata['host'], false, true);
  33. header('Location: '.$setting['url']);