cli.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Used for external support of chamilo's users
  5. *
  6. * @author Arnaud Ligot, CBlue SPRL
  7. * @package chamilo.admin.cli
  8. */
  9. // we are in the admin area so we do not need a course id
  10. $cidReset = true;
  11. // include global script
  12. require_once __DIR__.'/../inc/global.inc.php';
  13. $this_section = SECTION_PLATFORM_ADMIN;
  14. // make sure only logged-in admins can execute this
  15. api_protect_admin_script();
  16. /**
  17. * Main code
  18. */
  19. // setting the name of the tool
  20. $tool_name = get_lang('CommandLineInterpreter');
  21. // setting breadcrumbs
  22. $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
  23. // including the header file (which includes the banner itself)
  24. Display :: display_header($tool_name);
  25. switch ($_GET["cmd"]) {
  26. case "clear_stapi":
  27. 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>";
  28. break;
  29. case "clear_stapi_confirm":
  30. Database::query("delete from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES));
  31. Database::query("delete from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES_STACK));
  32. echo "Done";
  33. break;
  34. default:
  35. echo "UNKNOWN COMMAND";
  36. break;
  37. }
  38. /**
  39. * Footer
  40. */
  41. Display :: display_footer();