1
0

SessionCheck.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /*
  3. *
  4. * OGP - Open Game Panel
  5. * Copyright (C) Copyright (C) 2008 - 2015 The OGP Development Team
  6. *
  7. * http://www.opengamepanel.org/
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. *
  23. */
  24. if(file_exists("includes/helpers.php")){
  25. require_once("includes/helpers.php");
  26. }else{
  27. if(file_exists(__DIR__ . "/../../includes/helpers.php")){
  28. require_once(__DIR__ . '/../../includes/helpers.php');
  29. }
  30. }
  31. if(function_exists("startSession")){
  32. startSession();
  33. }else{
  34. session_name("opengamepanel_web");
  35. session_start();
  36. }
  37. if (isset($_SESSION['users_login']))
  38. $json['valid'] = true;
  39. else
  40. $json['valid'] = false;
  41. echo json_encode($json);
  42. ?>