cli.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. /**
  10. * Init section
  11. */
  12. // name of the language file that needs to be included
  13. $language_file = 'admin';
  14. // we are in the admin area so we do not need a course id
  15. $cidReset = true;
  16. // include global script
  17. require_once '../inc/global.inc.php';
  18. $this_section = SECTION_PLATFORM_ADMIN;
  19. // make sure only logged-in admins can execute this
  20. api_protect_admin_script();
  21. /**
  22. * Main code
  23. */
  24. // setting the name of the tool
  25. $tool_name = get_lang('CommandLineInterpreter');
  26. // setting breadcrumbs
  27. $interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
  28. // including the header file (which includes the banner itself)
  29. Display :: display_header($tool_name);
  30. switch ($_GET["cmd"]) {
  31. case "clear_stapi":
  32. 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>";
  33. break;
  34. case "clear_stapi_confirm":
  35. Database::query("delete from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES));
  36. Database::query("delete from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES_STACK));
  37. echo "Done";
  38. break;
  39. default:
  40. echo "UNKNOWN COMMAND";
  41. break;
  42. }
  43. /**
  44. * Footer
  45. */
  46. Display :: display_footer();