Пример #1
0
 /**
  * Upgrade to to the next version
  */
 public function upgrade()
 {
     // - data update for 1.4.0 media changes
     $_cfgs = Database::prepare("SELECT gs1.gedcom_id AS gedcom_id, gs1.setting_value AS media_directory, gs2.setting_value AS use_media_firewall, gs3.setting_value AS media_firewall_thumbs, gs4.setting_value AS media_firewall_rootdir" . " FROM `##gedcom_setting` gs1" . " LEFT JOIN `##gedcom_setting` gs2 ON (gs1.gedcom_id = gs2.gedcom_id AND gs2.setting_name='USE_MEDIA_FIREWALL')" . " LEFT JOIN `##gedcom_setting` gs3 ON (gs1.gedcom_id = gs3.gedcom_id AND gs3.setting_name='MEDIA_FIREWALL_THUMBS')" . " LEFT JOIN `##gedcom_setting` gs4 ON (gs1.gedcom_id = gs4.gedcom_id AND gs4.setting_name='MEDIA_FIREWALL_ROOTDIR')" . " WHERE gs1.setting_name = 'MEDIA_DIRECTORY'")->fetchAll();
     // The constant WT_DATA_DIR is not defined yet (although it was when this script was originally written).
     $WT_DATA_DIR = realpath('data');
     // Check the config for each tree
     foreach ($_cfgs as $_cfg) {
         if ($_cfg->use_media_firewall) {
             // We’re using the media firewall.
             $_mf_dir = realpath($_cfg->media_firewall_rootdir) . DIRECTORY_SEPARATOR;
             if ($_mf_dir == $WT_DATA_DIR) {
                 // We’re already storing our media in the data folder - nothing to do.
             } else {
                 // We’ve chosen a custom location for our media folder - need to update our media-folder to point to it.
                 // We have, for example,
                 // $_mf_dir = /home/fisharebest/my_pictures/
                 // $WT_DATA_DIR = /home/fisharebest/public_html/webtrees/data/
                 // Therefore we need to calculate ../../../my_pictures/
                 $_media_dir = '';
                 $_tmp_dir = $WT_DATA_DIR;
                 while (strpos($_mf_dir, $_tmp_dir) !== 0) {
                     $_media_dir .= '../';
                     $_tmp_dir = preg_replace('~[^/\\\\]+[/\\\\]$~', '', $_tmp_dir);
                     if ($_tmp_dir == '') {
                         // Shouldn't get here - but this script is not allowed to fail...
                         continue 2;
                     }
                 }
                 $_media_dir .= $_cfg->media_directory;
                 Database::prepare("UPDATE `##gedcom_setting`" . " SET setting_value=?" . " WHERE gedcom_id=? AND setting_name='MEDIA_DIRECTORY'")->execute(array($_media_dir, $_cfg->gedcom_id));
             }
         } else {
             // Not using the media firewall - just move the public folder to the new location (if we can).
             if (file_exists(WT_ROOT . $_cfg->media_directory) && is_dir(WT_ROOT . $_cfg->media_directory) && !file_exists($WT_DATA_DIR . $_cfg->media_directory)) {
                 try {
                     rename(WT_ROOT . $_cfg->media_directory, $WT_DATA_DIR . $_cfg->media_directory);
                 } catch (\ErrorException $ex) {
                     // Cannot move the folder?
                 }
                 File::delete($WT_DATA_DIR . $_cfg->media_directory . '.htaccess');
                 File::delete($WT_DATA_DIR . $_cfg->media_directory . 'index.php');
                 File::delete($WT_DATA_DIR . $_cfg->media_directory . 'Mediainfo.txt');
                 File::delete($WT_DATA_DIR . $_cfg->media_directory . 'thumbs/Thumbsinfo.txt');
             }
         }
     }
     // Delete old settings
     Database::exec("DELETE FROM `##gedcom_setting` WHERE setting_name IN ('USE_MEDIA_FIREWALL', 'MEDIA_FIREWALL_THUMBS', 'MEDIA_FIREWALL_ROOTDIR')");
 }
        // Create the unzipped GEDCOM on disk, so we can ZIP it.
        $stream = fopen($temp_dir . $download_filename, "w");
        FunctionsExport::exportGedcom($WT_TREE, $stream, $exportOptions);
        fclose($stream);
        // Create a ZIP file containing the GEDCOM file.
        $comment = "Created by " . WT_WEBTREES . " " . WT_VERSION . " on " . date("r") . ".";
        $archive = new PclZip($temp_dir . $zip_file);
        $v_list = $archive->add($temp_dir . $download_filename, \PCLZIP_OPT_COMMENT, $comment, \PCLZIP_OPT_REMOVE_PATH, $temp_dir);
        if ($v_list == 0) {
            echo "Error : " . $archive->errorInfo(true);
        } else {
            header('Content-Type: application/zip');
            header('Content-Disposition: attachment; filename="' . $zip_file . '"');
            header('Content-length: ' . filesize($temp_dir . $zip_file));
            readfile($temp_dir . $zip_file);
            File::delete($temp_dir);
        }
    } else {
        header('Content-Type: text/plain; charset=UTF-8');
        header('Content-Disposition: attachment; filename="' . $download_filename . '"');
        // Stream the GEDCOM file straight to the browser.
        // We could open "php://compress.zlib" to create a .gz file or "php://compress.bzip2" to create a .bz2 file
        $stream = fopen('php://output', 'w');
        FunctionsExport::exportGedcom($WT_TREE, $stream, $exportOptions);
        fclose($stream);
    }
    return;
}
$controller->pageHeader();
?>
<ol class="breadcrumb small">
Пример #3
0
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\Functions;
define('WT_SCRIPT_NAME', 'admin.php');
require './includes/session.php';
// This is a list of old files and directories, from earlier versions of webtrees, that can be deleted.
// It was generated with the help of a command like this:
// git diff 1.6.0..master --name-status | grep ^D
$old_files = array(WT_ROOT . 'language/en.mo', WT_ROOT . 'themechange.php', WT_ROOT . 'includes/extras', WT_ROOT . 'addremotelink.php', WT_ROOT . 'addsearchlink.php', WT_ROOT . 'client.php', WT_ROOT . 'dir_editor.php', WT_ROOT . 'editconfig_gedcom.php', WT_ROOT . 'editgedcoms.php', WT_ROOT . 'edit_merge.php', WT_ROOT . 'genservice.php', WT_ROOT . 'includes/classes', WT_ROOT . 'includes/controllers', WT_ROOT . 'includes/family_nav.php', WT_ROOT . 'logs.php', WT_ROOT . 'manageservers.php', WT_ROOT . 'media.php', WT_ROOT . 'module_admin.php', WT_ROOT . 'opensearch.php', WT_ROOT . 'PEAR.php', WT_ROOT . 'pgv_to_wt.php', WT_ROOT . 'places', WT_ROOT . 'serviceClientTest.php', WT_ROOT . 'siteconfig.php', WT_ROOT . 'SOAP', WT_ROOT . 'themes/clouds/mozilla.css', WT_ROOT . 'themes/clouds/netscape.css', WT_ROOT . 'themes/colors/mozilla.css', WT_ROOT . 'themes/colors/netscape.css', WT_ROOT . 'themes/fab/mozilla.css', WT_ROOT . 'themes/fab/netscape.css', WT_ROOT . 'themes/minimal/mozilla.css', WT_ROOT . 'themes/minimal/netscape.css', WT_ROOT . 'themes/webtrees/mozilla.css', WT_ROOT . 'themes/webtrees/netscape.css', WT_ROOT . 'themes/webtrees/style_rtl.css', WT_ROOT . 'themes/xenea/mozilla.css', WT_ROOT . 'themes/xenea/netscape.css', WT_ROOT . 'uploadmedia.php', WT_ROOT . 'useradmin.php', WT_ROOT . 'webservice', WT_ROOT . 'wtinfo.php', WT_ROOT . 'treenav.php', WT_ROOT . 'themes/clouds/jquery', WT_ROOT . 'themes/colors/jquery', WT_ROOT . 'themes/fab/jquery', WT_ROOT . 'themes/minimal/jquery', WT_ROOT . 'themes/webtrees/jquery', WT_ROOT . 'themes/xenea/jquery', WT_ROOT . 'themes/clouds/chrome.css', WT_ROOT . 'themes/clouds/opera.css', WT_ROOT . 'themes/clouds/print.css', WT_ROOT . 'themes/clouds/style_rtl.css', WT_ROOT . 'themes/colors/chrome.css', WT_ROOT . 'themes/colors/opera.css', WT_ROOT . 'themes/colors/print.css', WT_ROOT . 'themes/colors/style_rtl.css', WT_ROOT . 'themes/fab/chrome.css', WT_ROOT . 'themes/fab/opera.css', WT_ROOT . 'themes/minimal/chrome.css', WT_ROOT . 'themes/minimal/opera.css', WT_ROOT . 'themes/minimal/print.css', WT_ROOT . 'themes/minimal/style_rtl.css', WT_ROOT . 'themes/xenea/chrome.css', WT_ROOT . 'themes/xenea/opera.css', WT_ROOT . 'themes/xenea/print.css', WT_ROOT . 'themes/xenea/style_rtl.css', WT_ROOT . 'includes/cssparser.inc.php', WT_ROOT . 'modules_v3/gedcom_favorites/help_text.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_3_find.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_3_search_add.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_5_input.js', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_5_input.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_query_1a.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_query_2a.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_MEDIA/media_query_3a.php', WT_ROOT . 'modules_v3/lightbox/css/album_page_RTL2.css', WT_ROOT . 'modules_v3/lightbox/css/album_page_RTL.css', WT_ROOT . 'modules_v3/lightbox/css/album_page_RTL_ff.css', WT_ROOT . 'modules_v3/lightbox/css/clearbox_music.css', WT_ROOT . 'modules_v3/lightbox/css/clearbox_music_RTL.css', WT_ROOT . 'modules_v3/user_favorites/db_schema', WT_ROOT . 'modules_v3/user_favorites/help_text.php', WT_ROOT . 'search_engine.php', WT_ROOT . 'themes/clouds/modules.css', WT_ROOT . 'themes/colors/modules.css', WT_ROOT . 'themes/fab/modules.css', WT_ROOT . 'themes/minimal/modules.css', WT_ROOT . 'themes/webtrees/modules.css', WT_ROOT . 'themes/xenea/modules.css', WT_ROOT . 'includes/media_reorder_count.php', WT_ROOT . 'includes/media_tab_head.php', WT_ROOT . 'modules_v3/clippings/index.php', WT_ROOT . 'modules_v3/googlemap/css/googlemap_style.css', WT_ROOT . 'modules_v3/googlemap/css/wt_v3_places_edit.css', WT_ROOT . 'modules_v3/googlemap/index.php', WT_ROOT . 'modules_v3/lightbox/index.php', WT_ROOT . 'modules_v3/recent_changes/help_text.php', WT_ROOT . 'modules_v3/todays_events/help_text.php', WT_ROOT . 'sidebar.php', WT_ROOT . 'modules_v3/sitemap/admin_index.php', WT_ROOT . 'modules_v3/sitemap/help_text.php', WT_ROOT . 'modules_v3/tree/css/styles', WT_ROOT . 'modules_v3/tree/css/treebottom.gif', WT_ROOT . 'modules_v3/tree/css/treebottomleft.gif', WT_ROOT . 'modules_v3/tree/css/treebottomright.gif', WT_ROOT . 'modules_v3/tree/css/tree.jpg', WT_ROOT . 'modules_v3/tree/css/treeleft.gif', WT_ROOT . 'modules_v3/tree/css/treeright.gif', WT_ROOT . 'modules_v3/tree/css/treetop.gif', WT_ROOT . 'modules_v3/tree/css/treetopleft.gif', WT_ROOT . 'modules_v3/tree/css/treetopright.gif', WT_ROOT . 'modules_v3/tree/css/treeview_print.css', WT_ROOT . 'modules_v3/tree/help_text.php', WT_ROOT . 'modules_v3/tree/images/print.png', WT_ROOT . 'login_register.php', WT_ROOT . 'modules_v3/top10_givnnames/help_text.php', WT_ROOT . 'modules_v3/top10_surnames/help_text.php', WT_ROOT . 'admin_site_ipaddress.php', WT_ROOT . 'downloadgedcom.php', WT_ROOT . 'export_gedcom.php', WT_ROOT . 'gedcheck.php', WT_ROOT . 'images', WT_ROOT . 'includes/dmsounds_UTF8.php', WT_ROOT . 'includes/grampsxml.rng', WT_ROOT . 'includes/session_spider.php', WT_ROOT . 'modules_v3/googlemap/admin_editconfig.php', WT_ROOT . 'modules_v3/googlemap/admin_placecheck.php', WT_ROOT . 'modules_v3/googlemap/flags.php', WT_ROOT . 'modules_v3/googlemap/images/pedigree_map.gif', WT_ROOT . 'modules_v3/googlemap/pedigree_map.php', WT_ROOT . 'modules_v3/lightbox/admin_config.php', WT_ROOT . 'modules_v3/lightbox/album.php', WT_ROOT . 'modules_v3/tree/css/vline.jpg', WT_ROOT . 'imageflush.php', WT_ROOT . 'modules_v3/googlemap/wt_v3_pedigree_map.js.php', WT_ROOT . 'modules_v3/lightbox/js/tip_balloon_RTL.js', WT_ROOT . 'includes/set_gedcom_defaults.php', WT_ROOT . 'modules_v3/address_report', WT_ROOT . 'modules_v3/lightbox/functions/lb_horiz_sort.php', WT_ROOT . 'modules_v3/random_media/help_text.php', WT_ROOT . 'imageview.php', WT_ROOT . 'media/MediaInfo.txt', WT_ROOT . 'media/thumbs/ThumbsInfo.txt', WT_ROOT . 'modules_v3/GEDFact_assistant/css/media_0_inverselink.css', WT_ROOT . 'modules_v3/lightbox/help_text.php', WT_ROOT . 'modules_v3/lightbox/images/blank.gif', WT_ROOT . 'modules_v3/lightbox/images/close_1.gif', WT_ROOT . 'modules_v3/lightbox/images/image_add.gif', WT_ROOT . 'modules_v3/lightbox/images/image_copy.gif', WT_ROOT . 'modules_v3/lightbox/images/image_delete.gif', WT_ROOT . 'modules_v3/lightbox/images/image_edit.gif', WT_ROOT . 'modules_v3/lightbox/images/image_link.gif', WT_ROOT . 'modules_v3/lightbox/images/images.gif', WT_ROOT . 'modules_v3/lightbox/images/image_view.gif', WT_ROOT . 'modules_v3/lightbox/images/loading.gif', WT_ROOT . 'modules_v3/lightbox/images/next.gif', WT_ROOT . 'modules_v3/lightbox/images/nextlabel.gif', WT_ROOT . 'modules_v3/lightbox/images/norm_2.gif', WT_ROOT . 'modules_v3/lightbox/images/overlay.png', WT_ROOT . 'modules_v3/lightbox/images/prev.gif', WT_ROOT . 'modules_v3/lightbox/images/prevlabel.gif', WT_ROOT . 'modules_v3/lightbox/images/private.gif', WT_ROOT . 'modules_v3/lightbox/images/slideshow.jpg', WT_ROOT . 'modules_v3/lightbox/images/transp80px.gif', WT_ROOT . 'modules_v3/lightbox/images/zoom_1.gif', WT_ROOT . 'modules_v3/lightbox/js', WT_ROOT . 'modules_v3/lightbox/music', WT_ROOT . 'modules_v3/lightbox/pic', WT_ROOT . 'themes/_administration/jquery', WT_ROOT . 'themes/webtrees/chrome.css', WT_ROOT . 'modules_v3/lightbox/images/image_edit.png', WT_ROOT . 'modules_v3/lightbox/images/image_view.png', WT_ROOT . 'modules_v3/lightbox/images/image_view.png', WT_ROOT . 'modules_v3/top10_pageviews/help_text.php', WT_ROOT . 'themes/_administration/jquery-ui-1.10.0', WT_ROOT . 'themes/clouds/jquery-ui-1.10.0', WT_ROOT . 'themes/colors/jquery-ui-1.10.0', WT_ROOT . 'themes/fab/jquery-ui-1.10.0', WT_ROOT . 'themes/minimal/jquery-ui-1.10.0', WT_ROOT . 'themes/webtrees/jquery-ui-1.10.0', WT_ROOT . 'themes/xenea/jquery-ui-1.10.0', WT_ROOT . 'includes/media_reorder.php', WT_ROOT . 'includes/old_messages.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_CENS/census_note_decode.php', WT_ROOT . 'modules_v3/GEDFact_assistant/_CENS/census_asst_date.php', WT_ROOT . 'modules_v3/googlemap/wt_v3_googlemap.js.php', WT_ROOT . 'modules_v3/lightbox/functions/lightbox_print_media.php', WT_ROOT . 'modules_v3/upcoming_events/help_text.php', WT_ROOT . 'modules_v3/stories/help_text.php', WT_ROOT . 'modules_v3/user_messages/help_text.php', WT_ROOT . 'themes/_administration/favicon.png', WT_ROOT . 'themes/_administration/images', WT_ROOT . 'themes/_administration/msie.css', WT_ROOT . 'themes/_administration/style.css', WT_ROOT . 'themes/clouds/favicon.png', WT_ROOT . 'themes/clouds/images', WT_ROOT . 'themes/clouds/msie.css', WT_ROOT . 'themes/clouds/style.css', WT_ROOT . 'themes/colors/css', WT_ROOT . 'themes/colors/favicon.png', WT_ROOT . 'themes/colors/images', WT_ROOT . 'themes/colors/ipad.css', WT_ROOT . 'themes/colors/msie.css', WT_ROOT . 'themes/fab/favicon.png', WT_ROOT . 'themes/fab/images', WT_ROOT . 'themes/fab/msie.css', WT_ROOT . 'themes/fab/style.css', WT_ROOT . 'themes/minimal/favicon.png', WT_ROOT . 'themes/minimal/images', WT_ROOT . 'themes/minimal/msie.css', WT_ROOT . 'themes/minimal/style.css', WT_ROOT . 'themes/webtrees/favicon.png', WT_ROOT . 'themes/webtrees/images', WT_ROOT . 'themes/webtrees/msie.css', WT_ROOT . 'themes/webtrees/style.css', WT_ROOT . 'themes/xenea/favicon.png', WT_ROOT . 'themes/xenea/images', WT_ROOT . 'themes/xenea/msie.css', WT_ROOT . 'themes/xenea/style.css', WT_ROOT . 'themes/_administration/css-1.5.0', WT_ROOT . 'themes/clouds/css-1.5.0', WT_ROOT . 'themes/colors/css-1.5.0', WT_ROOT . 'themes/fab/css-1.5.0', WT_ROOT . 'themes/minimal/css-1.5.0', WT_ROOT . 'themes/webtrees/css-1.5.0', WT_ROOT . 'themes/xenea/css-1.5.0', WT_ROOT . 'themes/_administration/css-1.5.1', WT_ROOT . 'themes/clouds/css-1.5.1', WT_ROOT . 'themes/colors/css-1.5.1', WT_ROOT . 'themes/fab/css-1.5.1', WT_ROOT . 'themes/minimal/css-1.5.1', WT_ROOT . 'themes/webtrees/css-1.5.1', WT_ROOT . 'themes/xenea/css-1.5.1', WT_ROOT . 'modules_v3/GEDFact_assistant/_CENS/census_asst_help.php', WT_ROOT . 'modules_v3/googlemap/admin_places.php', WT_ROOT . 'modules_v3/googlemap/defaultconfig.php', WT_ROOT . 'modules_v3/googlemap/googlemap.php', WT_ROOT . 'modules_v3/googlemap/placehierarchy.php', WT_ROOT . 'modules_v3/googlemap/places_edit.php', WT_ROOT . 'modules_v3/googlemap/util.js', WT_ROOT . 'modules_v3/googlemap/wt_v3_places_edit.js.php', WT_ROOT . 'modules_v3/googlemap/wt_v3_places_edit_overlays.js.php', WT_ROOT . 'modules_v3/googlemap/wt_v3_street_view.php', WT_ROOT . 'readme.html', WT_ROOT . 'themes/_administration/css-1.5.2', WT_ROOT . 'themes/clouds/css-1.5.2', WT_ROOT . 'themes/colors/css-1.5.2', WT_ROOT . 'themes/fab/css-1.5.2', WT_ROOT . 'themes/minimal/css-1.5.2', WT_ROOT . 'themes/webtrees/css-1.5.2', WT_ROOT . 'themes/xenea/css-1.5.2', WT_ROOT . 'downloadbackup.php', WT_ROOT . 'modules_v3/ckeditor/ckeditor-4.3.2-custom', WT_ROOT . 'site-php-version.php', WT_ROOT . 'themes/_administration/css-1.5.3', WT_ROOT . 'themes/clouds/css-1.5.3', WT_ROOT . 'themes/colors/css-1.5.3', WT_ROOT . 'themes/fab/css-1.5.3', WT_ROOT . 'themes/minimal/css-1.5.3', WT_ROOT . 'themes/webtrees/css-1.5.3', WT_ROOT . 'themes/xenea/css-1.5.3', WT_ROOT . 'includes/authentication.php', WT_ROOT . 'themes/_administration/css-1.6.0', WT_ROOT . 'themes/_administration/jquery-ui-1.10.3', WT_ROOT . 'themes/clouds/css-1.6.0', WT_ROOT . 'themes/clouds/jquery-ui-1.10.3', WT_ROOT . 'themes/colors/css-1.6.0', WT_ROOT . 'themes/colors/jquery-ui-1.10.3', WT_ROOT . 'themes/fab/css-1.6.0', WT_ROOT . 'themes/fab/jquery-ui-1.10.3', WT_ROOT . 'themes/minimal/css-1.6.0', WT_ROOT . 'themes/minimal/jquery-ui-1.10.3', WT_ROOT . 'themes/webtrees/css-1.6.0', WT_ROOT . 'themes/webtrees/jquery-ui-1.10.3', WT_ROOT . 'themes/xenea/css-1.6.0', WT_ROOT . 'themes/xenea/jquery-ui-1.10.3', WT_ROOT . 'themes/_administration/css-1.6.0', WT_ROOT . 'themes/_administration/jquery-ui-1.10.3', WT_ROOT . 'admin_site_other.php', WT_ROOT . 'includes/config_data.php', WT_ROOT . 'includes/db_schema', WT_ROOT . 'includes/fonts', WT_ROOT . 'includes/functions', WT_ROOT . 'includes/hitcount.php', WT_ROOT . 'includes/reportheader.php', WT_ROOT . 'includes/specialchars.php', WT_ROOT . 'js', WT_ROOT . 'language/en_GB.mo', WT_ROOT . 'language/en_US.mo', WT_ROOT . 'language/pt_BR.mo', WT_ROOT . 'language/zh_CN.mo', WT_ROOT . 'language/extra', WT_ROOT . 'library', WT_ROOT . 'modules_v3/batch_update/admin_batch_update.php', WT_ROOT . 'modules_v3/batch_update/plugins', WT_ROOT . 'modules_v3/charts/help_text.php', WT_ROOT . 'modules_v3/ckeditor/ckeditor-4.4.1-custom', WT_ROOT . 'modules_v3/clippings/clippings_ctrl.php', WT_ROOT . 'modules_v3/clippings/help_text.php', WT_ROOT . 'modules_v3/faq/help_text.php', WT_ROOT . 'modules_v3/gedcom_favorites/db_schema', WT_ROOT . 'modules_v3/gedcom_news/db_schema', WT_ROOT . 'modules_v3/googlemap/db_schema', WT_ROOT . 'modules_v3/googlemap/help_text.php', WT_ROOT . 'modules_v3/html/help_text.php', WT_ROOT . 'modules_v3/logged_in/help_text.php', WT_ROOT . 'modules_v3/review_changes/help_text.php', WT_ROOT . 'modules_v3/todo/help_text.php', WT_ROOT . 'modules_v3/tree/class_treeview.php', WT_ROOT . 'modules_v3/user_blog/db_schema', WT_ROOT . 'modules_v3/yahrzeit/help_text.php', WT_ROOT . 'save.php', WT_ROOT . 'themes/_administration/css-1.6.2', WT_ROOT . 'themes/_administration/templates', WT_ROOT . 'themes/_administration/header.php', WT_ROOT . 'themes/_administration/footer.php', WT_ROOT . 'themes/clouds/css-1.6.2', WT_ROOT . 'themes/clouds/templates', WT_ROOT . 'themes/clouds/header.php', WT_ROOT . 'themes/clouds/footer.php', WT_ROOT . 'themes/colors/css-1.6.2', WT_ROOT . 'themes/colors/templates', WT_ROOT . 'themes/colors/header.php', WT_ROOT . 'themes/colors/footer.php', WT_ROOT . 'themes/fab/css-1.6.2', WT_ROOT . 'themes/fab/templates', WT_ROOT . 'themes/fab/header.php', WT_ROOT . 'themes/fab/footer.php', WT_ROOT . 'themes/minimal/css-1.6.2', WT_ROOT . 'themes/minimal/templates', WT_ROOT . 'themes/minimal/header.php', WT_ROOT . 'themes/minimal/footer.php', WT_ROOT . 'themes/webtrees/css-1.6.2', WT_ROOT . 'themes/webtrees/templates', WT_ROOT . 'themes/webtrees/header.php', WT_ROOT . 'themes/webtrees/footer.php', WT_ROOT . 'themes/xenea/css-1.6.2', WT_ROOT . 'themes/xenea/templates', WT_ROOT . 'themes/xenea/header.php', WT_ROOT . 'themes/xenea/footer.php', WT_ROOT . 'assets/js-1.7.0', WT_ROOT . 'packages/bootstrap-3.3.4', WT_ROOT . 'packages/bootstrap-datetimepicker-4.0.0', WT_ROOT . 'packages/ckeditor-4.4.7-custom', WT_ROOT . 'packages/font-awesome-4.3.0', WT_ROOT . 'packages/jquery-1.11.2', WT_ROOT . 'packages/jquery-2.1.3', WT_ROOT . 'packages/moment-2.10.3', WT_ROOT . 'includes/php_53_compatibility.php', WT_ROOT . 'modules_v3/GEDFact_assistant/census/date.js', WT_ROOT . 'modules_v3/GEDFact_assistant/census/dynamicoptionlist.js', WT_ROOT . 'packages/jquery-cookie-1.4.1/jquery.cookie.js');
// Delete old files (if we can).
$files_to_delete = array();
foreach ($old_files as $file) {
    if (file_exists($file) && !File::delete($file)) {
        $files_to_delete[] = $file;
    }
}
$controller = new PageController();
$controller->restrictAccess(Auth::isManager($WT_TREE))->setPageTitle(I18N::translate('Control panel') . ' — ' . I18N::translate('Dashboard'))->pageHeader();
// Check for updates
$latest_version_txt = Functions::fetchLatestVersion();
if (preg_match('/^[0-9.]+\\|[0-9.]+\\|/', $latest_version_txt)) {
    list($latest_version) = explode('|', $latest_version_txt);
} else {
    // Cannot determine the latest version
    $latest_version = '';
}
$update_available = Auth::isAdmin() && $latest_version && version_compare(WT_VERSION, $latest_version) < 0;
// Total number of users
Пример #4
0
    echo '<br>', I18N::translate('The file %s has been deleted.', Html::filename($lock_file)), $icon_success;
} else {
    echo '<br>', I18N::translate('The file %s could not be deleted.', Html::filename($lock_file)), $icon_failure;
}
echo '</li>';
////////////////////////////////////////////////////////////////////////////////
// Clean up
////////////////////////////////////////////////////////////////////////////////
echo '<li>', I18N::translate('Delete temporary files…');
reset_timeout();
if (File::delete($zip_dir)) {
    echo '<br>', I18N::translate('The folder %s has been deleted.', Html::filename($zip_dir)), $icon_success;
} else {
    echo '<br>', I18N::translate('The folder %s could not be deleted.', Html::filename($zip_dir)), $icon_failure;
}
if (File::delete($zip_file)) {
    echo '<br>', I18N::translate('The file %s has been deleted.', Html::filename($zip_file)), $icon_success;
} else {
    echo '<br>', I18N::translate('The file %s could not be deleted.', Html::filename($zip_file)), $icon_failure;
}
echo '</li>';
echo '</ul>';
echo '<p>', I18N::translate('The upgrade is complete.'), '</p>';
/**
 * Reset the time limit, as timeouts in this script could leave the upgrade incomplete.
 */
function reset_timeout()
{
    if (!ini_get('safe_mode') && strpos(ini_get('disable_functions'), 'set_time_limit') === false) {
        set_time_limit(ini_get('max_execution_time'));
    }
Пример #5
0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

use Fisharebest\Webtrees\Controller\PageController;
use Rhumsaa\Uuid\Uuid;
define('WT_SCRIPT_NAME', 'admin_site_clean.php');
require './includes/session.php';
$to_delete = Filter::postArray('to_delete');
if ($to_delete && Filter::checkCsrf()) {
    foreach ($to_delete as $path) {
        $is_dir = is_dir(WT_DATA_DIR . $path);
        if (File::delete(WT_DATA_DIR . $path)) {
            if ($is_dir) {
                FlashMessages::addMessage(I18N::translate('The folder %s has been deleted.', Filter::escapeHtml($path)), 'success');
            } else {
                FlashMessages::addMessage(I18N::translate('The file %s has been deleted.', Filter::escapeHtml($path)), 'success');
            }
        } else {
            if ($is_dir) {
                FlashMessages::addMessage(I18N::translate('The folder %s could not be deleted.', Filter::escapeHtml($path)), 'danger');
            } else {
                FlashMessages::addMessage(I18N::translate('The file %s could not be deleted.', Filter::escapeHtml($path)), 'danger');
            }
        }
    }
    header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
    return;
Пример #6
0
 /** {@inheritdoc} */
 public function modAction($mod_action)
 {
     switch ($mod_action) {
         case 'admin_config':
             if (Filter::postBool('save') && Filter::checkCsrf()) {
                 $this->setSetting('FTV_PDF_ACCESS_LEVEL', Filter::postInteger('NEW_FTV_PDF_ACCESS_LEVEL'));
                 Log::addConfigurationLog($this->getTitle() . ' config updated');
             }
             $template = new AdminTemplate();
             return $template->pageContent();
         case 'full_pdf':
             echo $this->module()->printPage(0);
             break;
         case 'write_pdf':
             $tmp_dir = WT_DATA_DIR . 'ftv_pdf_tmp/';
             if (file_exists($tmp_dir)) {
                 File::delete($tmp_dir);
             }
             File::mkdir($tmp_dir);
             $template = new PdfTemplate();
             return $template->pageBody();
         case 'output_pdf':
             $file = WT_DATA_DIR . 'ftv_pdf_tmp/' . Filter::get('title') . '.pdf';
             if (file_exists($file)) {
                 ob_start();
                 header('Content-Description: File Transfer');
                 header('Content-Type: application/pdf');
                 header('Content-Disposition: attachment; filename="' . basename($file) . '"');
                 header('Content-Transfer-Encoding: binary');
                 header('Expires: 0');
                 header('Cache-Control: must-revalidate');
                 header('Pragma: public');
                 ob_clean();
                 ob_end_flush();
                 readfile($file);
                 File::delete(dirname($file));
             } else {
                 FlashMessages::addMessage(I18N::translate('The file %s could not be created.', basename($file)), 'danger');
                 Header('Location:' . WT_BASE_URL . 'module.php?mod=fancy_treeview&mod_action=page&rootid=' . Filter::get('rootid') . '&ged=' . Filter::get('ged'));
             }
             break;
         default:
             http_response_code(404);
             break;
     }
 }
Пример #7
0
reset_timeout();
if (File::delete($zip_dir)) {
    echo '<br>', I18N::translate('The folder %s has been deleted.', Html::filename($zip_dir)), $icon_success;
} else {
    echo '<br>', I18N::translate('The folder %s could not be deleted.', Html::filename($zip_dir)), $icon_failure;
}
if (File::delete($zip_file)) {
    echo '<br>', I18N::translate('The file %s has been deleted.', Html::filename($zip_file)), $icon_success;
} else {
    echo '<br>', I18N::translate('The file %s could not be deleted.', Html::filename($zip_file)), $icon_failure;
}
echo '</li>';
echo '</ul>';
// We have updated the language files.
foreach (glob(WT_DATA_DIR . 'cache/language-*') as $file) {
    File::delete($file);
}
echo '<p>', I18N::translate('The upgrade is complete.'), '</p>';
/**
 * Reset the time limit, as timeouts in this script could leave the upgrade incomplete.
 */
function reset_timeout()
{
    if (!ini_get('safe_mode') && strpos(ini_get('disable_functions'), 'set_time_limit') === false) {
        try {
            set_time_limit(ini_get('max_execution_time'));
        } catch (Exception $ex) {
            // "set_time_limt(): Cannot set max execution time limit due to system policy"
        }
    }
}