cli.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. // setting the name of the tool
  17. $tool_name = get_lang('CommandLineInterpreter');
  18. // setting breadcrumbs
  19. $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
  20. // including the header file (which includes the banner itself)
  21. Display :: display_header($tool_name);
  22. switch ($_GET["cmd"]) {
  23. case "clear_stapi":
  24. echo "Are you sure you are willing to erase all storage api data (no backup)? <a href='cli.php?cmd=clear_stapi_confirm' >Yes</a>";
  25. break;
  26. case "clear_stapi_confirm":
  27. Database::query("delete from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES));
  28. Database::query("delete from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES_STACK));
  29. echo "Done";
  30. break;
  31. default:
  32. echo "UNKNOWN COMMAND";
  33. break;
  34. }
  35. Display :: display_footer();