cli.php 1.3 KB

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