cli.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /* For licensing terms, see /dokeos_license.txt */
  3. /**
  4. ==============================================================================
  5. * Used for external support of chamilo's users
  6. *
  7. * @author Arnaud Ligot, CBlue SPRL
  8. * @package dokeos.admin
  9. ==============================================================================
  10. */
  11. /*
  12. ==============================================================================
  13. INIT SECTION
  14. ==============================================================================
  15. */
  16. // name of the language file that needs to be included
  17. $language_file = 'admin';
  18. // we are in the admin area so we do not need a course id
  19. $cidReset = true;
  20. // include global script
  21. require_once '../inc/global.inc.php';
  22. $this_section = SECTION_PLATFORM_ADMIN;
  23. api_protect_admin_script();
  24. /*
  25. ==============================================================================
  26. MAIN CODE
  27. ==============================================================================
  28. */
  29. // setting the name of the tool
  30. $tool_name = get_lang('CLI');
  31. // setting breadcrumbs
  32. $interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
  33. // including the header file (which includes the banner itself)
  34. Display :: display_header($tool_name);
  35. switch ($_GET["cmd"]) {
  36. case "clear_stapi":
  37. echo "Are you sure you are willing to erease all storage api data (no backup)? <a href='cli.php?cmd=clear_stapi_confirm' >Yes</a>";
  38. break;
  39. case "clear_stapi_confirm":
  40. Database::query("delete from ".Database::get_main_table(TABLE_MAIN_STORED_VALUES));
  41. Database::query("delete from ".Database::get_main_table(TABLE_MAIN_STORED_STACK));
  42. echo "Done";
  43. break;
  44. default:
  45. echo "UNKNOWN COMMAND";
  46. break;
  47. }
  48. /*
  49. ==============================================================================
  50. FOOTER
  51. ==============================================================================
  52. */
  53. Display :: display_footer();
  54. ?>