12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- /* For licensing terms, see /license.txt */
- use Chamilo\CoreBundle\Framework\Container;
- /**
- * @package chamilo.admin
- */
- // resetting the course id
- $cidReset = true;
- // setting the section (for the tabs)
- $this_section = SECTION_PLATFORM_ADMIN;
- // Access restrictions
- api_protect_admin_script(true);
- // setting breadcrumbs
- $interbreadcrumb[] = array('url' => Container::getRouter()->generate('administration'),'name' => get_lang('PlatformAdmin'));
- $form = new FormValidator('archive_cleanup_form', 'post', '', '', array(), FormValidator::LAYOUT_BOX);
- $form->addButtonSend(get_lang('ArchiveDirCleanupProceedButton'));
- if ($form->validate()) {
- $archive_path = api_get_path(SYS_ARCHIVE_PATH);
- $htaccess = @file_get_contents($archive_path.'.htaccess');
- $result = rmdirr($archive_path, true, true);
- \Chamilo\CoreBundle\Composer\ScriptHandler::dumpCssFiles();
- if (!empty($htaccess)) {
- @file_put_contents($archive_path.'/.htaccess', $htaccess);
- }
- if ($result) {
- Display::addFlash(Display::return_message(get_lang('ArchiveDirCleanupSucceeded')));
- } else {
- Display::addFlash(Display::return_message(get_lang('ArchiveDirCleanupFailed'), 'error'));
- }
- header('Location: '.api_get_self());
- exit;
- }
- Display::display_header(get_lang('ArchiveDirCleanup'));
- Display::display_warning_message(get_lang('ArchiveDirCleanupDescr'));
- $form->display();
- Display::display_footer();
|