skala
Yannick Warnier 14 years ago
parent d1c7aaf988
commit 002bad5846
  1. 65
      main/admin/cli.php

@ -1,65 +1,46 @@
<?php <?php
/* For licensing terms, see /dokeos_license.txt */ /* For licensing terms, see /license.txt */
/** /**
==============================================================================
* Used for external support of chamilo's users * Used for external support of chamilo's users
* *
* @author Arnaud Ligot, CBlue SPRL * @author Arnaud Ligot, CBlue SPRL
* @package dokeos.admin * @package chamilo.admin.cli
==============================================================================
*/
/*
==============================================================================
INIT SECTION
==============================================================================
*/ */
/**
* Init section
*/
// name of the language file that needs to be included // name of the language file that needs to be included
$language_file = 'admin'; $language_file = 'admin';
// we are in the admin area so we do not need a course id // we are in the admin area so we do not need a course id
$cidReset = true; $cidReset = true;
// include global script // include global script
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
// make sure only logged-in admins can execute this
api_protect_admin_script(); api_protect_admin_script();
/**
* Main code
/* */
==============================================================================
MAIN CODE
==============================================================================
*/
// setting the name of the tool // setting the name of the tool
$tool_name = get_lang('CLI'); $tool_name = get_lang('CLI');
// setting breadcrumbs // setting breadcrumbs
$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); $interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
// including the header file (which includes the banner itself) // including the header file (which includes the banner itself)
Display :: display_header($tool_name); Display :: display_header($tool_name);
switch ($_GET["cmd"]) { switch ($_GET["cmd"]) {
case "clear_stapi": case "clear_stapi":
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>"; 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>";
break; break;
case "clear_stapi_confirm": case "clear_stapi_confirm":
Database::query("delete from ".Database::get_main_table(TABLE_MAIN_STORED_VALUES)); Database::query("delete from ".Database::get_main_table(TABLE_MAIN_STORED_VALUES));
Database::query("delete from ".Database::get_main_table(TABLE_MAIN_STORED_STACK)); Database::query("delete from ".Database::get_main_table(TABLE_MAIN_STORED_STACK));
echo "Done"; echo "Done";
break; break;
default: default:
echo "UNKNOWN COMMAND"; echo "UNKNOWN COMMAND";
break; break;
} }
/**
/* * Footer
============================================================================== */
FOOTER
==============================================================================
*/
Display :: display_footer(); Display :: display_footer();
?>

Loading…
Cancel
Save