listContent()) == 0) { return $zipfile; } // Determine the extract directory $slpos = strrpos($zipfile, "/"); if (!$slpos) $slpos = strrpos($zipfile, "\\"); if ($slpos) $path = substr($zipfile, 0, $slpos+1); else $path = $INDEX_DIRECTORY; // Scan the files and return the first .ged found foreach ($list as $key=>$listitem) { if (($listitem["status"]="ok") && (strstr(strtolower($listitem["filename"]), ".")==".ged")) { $filename = basename($listitem["filename"]); if ($extract == false) return $filename; // if the gedcom exists, save the old one. NOT to bak as it will be overwritten on import if (file_exists($path.$filename)) { if (file_exists($path.$filename.".old")) unlink($path.$filename.".old"); copy($path.$filename, $path.$filename.".old"); unlink($path.$filename); } if ($zip->extract(PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_PATH, $path, PCLZIP_OPT_BY_NAME, $listitem["filename"]) == 0) { echo "ERROR cannot extract ZIP"; } return $filename; } } return $zipfile; } $errors=false; $error_msg=''; $PRIVACY_CONSTANTS=array( 'none' =>i18n::translate('Show to visitors'), 'privacy' =>i18n::translate('Show to members'), 'confidential'=>i18n::translate('Show to managers'), 'hidden' =>i18n::translate('Hide from everyone') ); switch (safe_POST('action')) { case 'delete': WT_DB::prepare( "DELETE FROM `##default_resn` WHERE default_resn_id=?" )->execute(array(safe_POST('default_resn_id'))); // Reload the page, so that the new privacy restrictions are reflected in the header header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.WT_SCRIPT_NAME.'#privacy'); exit; case 'add': if ((safe_POST('xref') || safe_POST('tag_type')) && safe_POST('resn')) { WT_DB::prepare( "REPLACE INTO `##default_resn` (gedcom_id, xref, tag_type, resn) VALUES (?, ?, ?, ?)" )->execute(array(WT_GED_ID, safe_POST('xref'), safe_POST('tag_type'), safe_POST('resn'))); } // Reload the page, so that the new privacy restrictions are reflected in the header header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.WT_SCRIPT_NAME.'#privacy'); exit; case 'update': $_POST["NEW_MEDIA_DIRECTORY"] = trim(str_replace('\\','/',$_POST["NEW_MEDIA_DIRECTORY"])); if (substr ($_POST["NEW_MEDIA_DIRECTORY"], -1) != "/") $_POST["NEW_MEDIA_DIRECTORY"] = $_POST["NEW_MEDIA_DIRECTORY"] . "/"; if (substr($_POST["NEW_MEDIA_DIRECTORY"], 0, 2)=="./") $_POST["NEW_MEDIA_DIRECTORY"] = substr($_POST["NEW_MEDIA_DIRECTORY"], 2); if (preg_match("/.*[a-zA-Z]{1}:.*/", $_POST["NEW_MEDIA_DIRECTORY"])>0) $errors = true; if ($_POST["NEW_USE_MEDIA_FIREWALL"]==true) { if (substr($_POST["NEW_MEDIA_DIRECTORY"], 0, 3)=="../") $_POST["NEW_MEDIA_DIRECTORY"] = substr($_POST["NEW_MEDIA_DIRECTORY"], 3); if (substr($_POST["NEW_MEDIA_DIRECTORY"], 0, 1)=="/") $_POST["NEW_MEDIA_DIRECTORY"] = substr($_POST["NEW_MEDIA_DIRECTORY"], 1); } set_gedcom_setting(WT_GED_ID, 'ABBREVIATE_CHART_LABELS', safe_POST_bool('NEW_ABBREVIATE_CHART_LABELS')); set_gedcom_setting(WT_GED_ID, 'ADVANCED_NAME_FACTS', safe_POST('NEW_ADVANCED_NAME_FACTS')); set_gedcom_setting(WT_GED_ID, 'ADVANCED_PLAC_FACTS', safe_POST('NEW_ADVANCED_PLAC_FACTS')); set_gedcom_setting(WT_GED_ID, 'ALLOW_EDIT_GEDCOM', safe_POST_bool('NEW_ALLOW_EDIT_GEDCOM')); set_gedcom_setting(WT_GED_ID, 'ALLOW_THEME_DROPDOWN', safe_POST_bool('NEW_ALLOW_THEME_DROPDOWN')); set_gedcom_setting(WT_GED_ID, 'AUTO_GENERATE_THUMBS', safe_POST_bool('NEW_AUTO_GENERATE_THUMBS')); set_gedcom_setting(WT_GED_ID, 'CALENDAR_FORMAT', safe_POST('NEW_CALENDAR_FORMAT')); set_gedcom_setting(WT_GED_ID, 'CHART_BOX_TAGS', safe_POST('NEW_CHART_BOX_TAGS')); set_gedcom_setting(WT_GED_ID, 'COMMON_NAMES_ADD', str_replace(' ', '', safe_POST('NEW_COMMON_NAMES_ADD'))); set_gedcom_setting(WT_GED_ID, 'COMMON_NAMES_REMOVE', str_replace(' ', '', safe_POST('NEW_COMMON_NAMES_REMOVE'))); set_gedcom_setting(WT_GED_ID, 'COMMON_NAMES_THRESHOLD', safe_POST('NEW_COMMON_NAMES_THRESHOLD', WT_REGEX_INTEGER, 40)); set_gedcom_setting(WT_GED_ID, 'CONTACT_USER_ID', safe_POST('NEW_CONTACT_USER_ID')); set_gedcom_setting(WT_GED_ID, 'DEFAULT_PEDIGREE_GENERATIONS', safe_POST('NEW_DEFAULT_PEDIGREE_GENERATIONS')); set_gedcom_setting(WT_GED_ID, 'DISPLAY_JEWISH_GERESHAYIM', safe_POST_bool('NEW_DISPLAY_JEWISH_GERESHAYIM')); set_gedcom_setting(WT_GED_ID, 'DISPLAY_JEWISH_THOUSANDS', safe_POST_bool('NEW_DISPLAY_JEWISH_THOUSANDS')); set_gedcom_setting(WT_GED_ID, 'ENABLE_AUTOCOMPLETE', safe_POST_bool('NEW_ENABLE_AUTOCOMPLETE')); set_gedcom_setting(WT_GED_ID, 'EXPAND_NOTES', safe_POST_bool('NEW_EXPAND_NOTES')); set_gedcom_setting(WT_GED_ID, 'EXPAND_RELATIVES_EVENTS', safe_POST_bool('NEW_EXPAND_RELATIVES_EVENTS')); set_gedcom_setting(WT_GED_ID, 'EXPAND_SOURCES', safe_POST_bool('NEW_EXPAND_SOURCES')); set_gedcom_setting(WT_GED_ID, 'FAM_FACTS_ADD', str_replace(' ', '', safe_POST('NEW_FAM_FACTS_ADD'))); set_gedcom_setting(WT_GED_ID, 'FAM_FACTS_QUICK', str_replace(' ', '', safe_POST('NEW_FAM_FACTS_QUICK'))); set_gedcom_setting(WT_GED_ID, 'FAM_FACTS_UNIQUE', str_replace(' ', '', safe_POST('NEW_FAM_FACTS_UNIQUE'))); set_gedcom_setting(WT_GED_ID, 'FAM_ID_PREFIX', safe_POST('NEW_FAM_ID_PREFIX')); set_gedcom_setting(WT_GED_ID, 'FULL_SOURCES', safe_POST_bool('NEW_FULL_SOURCES')); set_gedcom_setting(WT_GED_ID, 'GEDCOM_DEFAULT_TAB', safe_POST('NEW_GEDCOM_DEFAULT_TAB')); set_gedcom_setting(WT_GED_ID, 'GEDCOM_ID_PREFIX', safe_POST('NEW_GEDCOM_ID_PREFIX')); set_gedcom_setting(WT_GED_ID, 'GENERATE_UIDS', safe_POST_bool('NEW_GENERATE_UIDS')); set_gedcom_setting(WT_GED_ID, 'HIDE_GEDCOM_ERRORS', !safe_POST_bool('NEW_HIDE_GEDCOM_ERRORS')); set_gedcom_setting(WT_GED_ID, 'HIDE_LIVE_PEOPLE', safe_POST_bool('NEW_HIDE_LIVE_PEOPLE')); set_gedcom_setting(WT_GED_ID, 'INDI_FACTS_ADD', str_replace(' ', '', safe_POST('NEW_INDI_FACTS_ADD'))); set_gedcom_setting(WT_GED_ID, 'INDI_FACTS_QUICK', str_replace(' ', '', safe_POST('NEW_INDI_FACTS_QUICK'))); set_gedcom_setting(WT_GED_ID, 'INDI_FACTS_UNIQUE', str_replace(' ', '', safe_POST('NEW_INDI_FACTS_UNIQUE'))); set_gedcom_setting(WT_GED_ID, 'KEEP_ALIVE_YEARS_BIRTH', safe_POST('KEEP_ALIVE_YEARS_BIRTH', WT_REGEX_INTEGER, 0)); set_gedcom_setting(WT_GED_ID, 'KEEP_ALIVE_YEARS_DEATH', safe_POST('KEEP_ALIVE_YEARS_DEATH', WT_REGEX_INTEGER, 0)); set_gedcom_setting(WT_GED_ID, 'LANGUAGE', safe_POST('GEDCOMLANG')); set_gedcom_setting(WT_GED_ID, 'LINK_ICONS', safe_POST('NEW_LINK_ICONS')); set_gedcom_setting(WT_GED_ID, 'MAX_ALIVE_AGE', safe_POST('MAX_ALIVE_AGE', WT_REGEX_INTEGER, 100)); set_gedcom_setting(WT_GED_ID, 'MAX_DESCENDANCY_GENERATIONS', safe_POST('NEW_MAX_DESCENDANCY_GENERATIONS')); set_gedcom_setting(WT_GED_ID, 'MAX_PEDIGREE_GENERATIONS', safe_POST('NEW_MAX_PEDIGREE_GENERATIONS')); set_gedcom_setting(WT_GED_ID, 'MEDIA_DIRECTORY', safe_POST('NEW_MEDIA_DIRECTORY')); set_gedcom_setting(WT_GED_ID, 'MEDIA_DIRECTORY_LEVELS', safe_POST('NEW_MEDIA_DIRECTORY_LEVELS')); set_gedcom_setting(WT_GED_ID, 'MEDIA_EXTERNAL', safe_POST_bool('NEW_MEDIA_EXTERNAL')); set_gedcom_setting(WT_GED_ID, 'MEDIA_FIREWALL_THUMBS', safe_POST_bool('NEW_MEDIA_FIREWALL_THUMBS')); set_gedcom_setting(WT_GED_ID, 'MEDIA_ID_PREFIX', safe_POST('NEW_MEDIA_ID_PREFIX')); set_gedcom_setting(WT_GED_ID, 'META_DESCRIPTION', safe_POST('NEW_META_DESCRIPTION')); set_gedcom_setting(WT_GED_ID, 'META_ROBOTS', safe_POST('NEW_META_ROBOTS')); set_gedcom_setting(WT_GED_ID, 'META_TITLE', safe_POST('NEW_META_TITLE')); set_gedcom_setting(WT_GED_ID, 'MULTI_MEDIA', safe_POST_bool('NEW_MULTI_MEDIA')); set_gedcom_setting(WT_GED_ID, 'NOTE_ID_PREFIX', safe_POST('NEW_NOTE_ID_PREFIX')); set_gedcom_setting(WT_GED_ID, 'NO_UPDATE_CHAN', safe_POST_bool('NEW_NO_UPDATE_CHAN')); set_gedcom_setting(WT_GED_ID, 'PEDIGREE_FULL_DETAILS', safe_POST_bool('NEW_PEDIGREE_FULL_DETAILS')); set_gedcom_setting(WT_GED_ID, 'PEDIGREE_LAYOUT', safe_POST_bool('NEW_PEDIGREE_LAYOUT')); set_gedcom_setting(WT_GED_ID, 'PEDIGREE_ROOT_ID', safe_POST('NEW_PEDIGREE_ROOT_ID')); set_gedcom_setting(WT_GED_ID, 'PEDIGREE_SHOW_GENDER', safe_POST_bool('NEW_PEDIGREE_SHOW_GENDER')); set_gedcom_setting(WT_GED_ID, 'POSTAL_CODE', safe_POST_bool('NEW_POSTAL_CODE')); set_gedcom_setting(WT_GED_ID, 'PREFER_LEVEL2_SOURCES', safe_POST('NEW_PREFER_LEVEL2_SOURCES')); set_gedcom_setting(WT_GED_ID, 'QUICK_REQUIRED_FACTS', safe_POST('NEW_QUICK_REQUIRED_FACTS')); set_gedcom_setting(WT_GED_ID, 'QUICK_REQUIRED_FAMFACTS', safe_POST('NEW_QUICK_REQUIRED_FAMFACTS')); set_gedcom_setting(WT_GED_ID, 'REPO_FACTS_ADD', str_replace(' ', '', safe_POST('NEW_REPO_FACTS_ADD'))); set_gedcom_setting(WT_GED_ID, 'REPO_FACTS_QUICK', str_replace(' ', '', safe_POST('NEW_REPO_FACTS_QUICK'))); set_gedcom_setting(WT_GED_ID, 'REPO_FACTS_UNIQUE', str_replace(' ', '', safe_POST('NEW_REPO_FACTS_UNIQUE'))); set_gedcom_setting(WT_GED_ID, 'REPO_ID_PREFIX', safe_POST('NEW_REPO_ID_PREFIX')); set_gedcom_setting(WT_GED_ID, 'REQUIRE_AUTHENTICATION', safe_POST_bool('NEW_REQUIRE_AUTHENTICATION')); set_gedcom_setting(WT_GED_ID, 'SAVE_WATERMARK_IMAGE', safe_POST_bool('NEW_SAVE_WATERMARK_IMAGE')); set_gedcom_setting(WT_GED_ID, 'SAVE_WATERMARK_THUMB', safe_POST_bool('NEW_SAVE_WATERMARK_THUMB')); set_gedcom_setting(WT_GED_ID, 'SHOW_AGE_DIFF', safe_POST_bool('NEW_SHOW_AGE_DIFF')); set_gedcom_setting(WT_GED_ID, 'SHOW_CONTEXT_HELP', safe_POST_bool('NEW_SHOW_CONTEXT_HELP')); set_gedcom_setting(WT_GED_ID, 'SHOW_COUNTER', safe_POST_bool('NEW_SHOW_COUNTER')); set_gedcom_setting(WT_GED_ID, 'SHOW_DEAD_PEOPLE', safe_POST('SHOW_DEAD_PEOPLE')); set_gedcom_setting(WT_GED_ID, 'SHOW_EMPTY_BOXES', safe_POST_bool('NEW_SHOW_EMPTY_BOXES')); set_gedcom_setting(WT_GED_ID, 'SHOW_EST_LIST_DATES', safe_POST_bool('NEW_SHOW_EST_LIST_DATES')); set_gedcom_setting(WT_GED_ID, 'SHOW_FACT_ICONS', safe_POST_bool('NEW_SHOW_FACT_ICONS')); set_gedcom_setting(WT_GED_ID, 'SHOW_GEDCOM_RECORD', safe_POST_bool('NEW_SHOW_GEDCOM_RECORD')); set_gedcom_setting(WT_GED_ID, 'SHOW_HIGHLIGHT_IMAGES', safe_POST_bool('NEW_SHOW_HIGHLIGHT_IMAGES')); set_gedcom_setting(WT_GED_ID, 'SHOW_LAST_CHANGE', safe_POST_bool('NEW_SHOW_LAST_CHANGE')); set_gedcom_setting(WT_GED_ID, 'SHOW_LDS_AT_GLANCE', safe_POST_bool('NEW_SHOW_LDS_AT_GLANCE')); set_gedcom_setting(WT_GED_ID, 'SHOW_LEVEL2_NOTES', safe_POST_bool('NEW_SHOW_LEVEL2_NOTES')); set_gedcom_setting(WT_GED_ID, 'SHOW_LIST_PLACES', safe_POST('NEW_SHOW_LIST_PLACES')); set_gedcom_setting(WT_GED_ID, 'SHOW_LIVING_NAMES', safe_POST('SHOW_LIVING_NAMES')); set_gedcom_setting(WT_GED_ID, 'SHOW_MARRIED_NAMES', safe_POST_bool('NEW_SHOW_MARRIED_NAMES')); set_gedcom_setting(WT_GED_ID, 'SHOW_MEDIA_DOWNLOAD', safe_POST_bool('NEW_SHOW_MEDIA_DOWNLOAD')); set_gedcom_setting(WT_GED_ID, 'SHOW_MEDIA_FILENAME', safe_POST_bool('NEW_SHOW_MEDIA_FILENAME')); set_gedcom_setting(WT_GED_ID, 'SHOW_MULTISITE_SEARCH', safe_POST('SHOW_MULTISITE_SEARCH')); set_gedcom_setting(WT_GED_ID, 'SHOW_NO_WATERMARK', safe_POST('NEW_SHOW_NO_WATERMARK')); set_gedcom_setting(WT_GED_ID, 'SHOW_PARENTS_AGE', safe_POST_bool('NEW_SHOW_PARENTS_AGE')); set_gedcom_setting(WT_GED_ID, 'SHOW_PEDIGREE_PLACES', safe_POST('NEW_SHOW_PEDIGREE_PLACES')); set_gedcom_setting(WT_GED_ID, 'SHOW_PRIVATE_RELATIONSHIPS', safe_POST('SHOW_PRIVATE_RELATIONSHIPS')); set_gedcom_setting(WT_GED_ID, 'SHOW_REGISTER_CAUTION', safe_POST_bool('NEW_SHOW_REGISTER_CAUTION')); set_gedcom_setting(WT_GED_ID, 'SHOW_RELATIVES_EVENTS', safe_POST('NEW_SHOW_RELATIVES_EVENTS')); set_gedcom_setting(WT_GED_ID, 'SHOW_SPIDER_TAGLINE', safe_POST_bool('NEW_SHOW_SPIDER_TAGLINE')); set_gedcom_setting(WT_GED_ID, 'SHOW_STATS', safe_POST_bool('NEW_SHOW_STATS')); set_gedcom_setting(WT_GED_ID, 'SOURCE_ID_PREFIX', safe_POST('NEW_SOURCE_ID_PREFIX')); set_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_ADD', str_replace(' ', '', safe_POST('NEW_SOUR_FACTS_ADD'))); set_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_QUICK', str_replace(' ', '', safe_POST('NEW_SOUR_FACTS_QUICK'))); set_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_UNIQUE', str_replace(' ', '', safe_POST('NEW_SOUR_FACTS_UNIQUE'))); set_gedcom_setting(WT_GED_ID, 'SPLIT_PLACES', safe_POST_bool('NEW_SPLIT_PLACES')); set_gedcom_setting(WT_GED_ID, 'SUBLIST_TRIGGER_F', safe_POST('NEW_SUBLIST_TRIGGER_F', WT_REGEX_INTEGER, 200)); set_gedcom_setting(WT_GED_ID, 'SUBLIST_TRIGGER_I', safe_POST('NEW_SUBLIST_TRIGGER_I', WT_REGEX_INTEGER, 200)); set_gedcom_setting(WT_GED_ID, 'SURNAME_LIST_STYLE', safe_POST('NEW_SURNAME_LIST_STYLE')); set_gedcom_setting(WT_GED_ID, 'SURNAME_TRADITION', safe_POST('NEW_SURNAME_TRADITION')); set_gedcom_setting(WT_GED_ID, 'THEME_DIR', safe_POST('NEW_THEME_DIR')); set_gedcom_setting(WT_GED_ID, 'THUMBNAIL_WIDTH', safe_POST('NEW_THUMBNAIL_WIDTH')); set_gedcom_setting(WT_GED_ID, 'UNDERLINE_NAME_QUOTES', safe_POST_bool('NEW_UNDERLINE_NAME_QUOTES')); set_gedcom_setting(WT_GED_ID, 'USE_GEONAMES', safe_POST_bool('NEW_USE_GEONAMES')); set_gedcom_setting(WT_GED_ID, 'USE_MEDIA_FIREWALL', safe_POST_bool('NEW_USE_MEDIA_FIREWALL')); set_gedcom_setting(WT_GED_ID, 'USE_MEDIA_VIEWER', safe_POST_bool('NEW_USE_MEDIA_VIEWER')); set_gedcom_setting(WT_GED_ID, 'USE_RIN', safe_POST_bool('NEW_USE_RIN')); set_gedcom_setting(WT_GED_ID, 'USE_SILHOUETTE', safe_POST_bool('NEW_USE_SILHOUETTE')); set_gedcom_setting(WT_GED_ID, 'USE_THUMBS_MAIN', safe_POST_bool('NEW_USE_THUMBS_MAIN')); set_gedcom_setting(WT_GED_ID, 'WATERMARK_THUMB', safe_POST_bool('NEW_WATERMARK_THUMB')); set_gedcom_setting(WT_GED_ID, 'WEBMASTER_USER_ID', safe_POST('NEW_WEBMASTER_USER_ID')); set_gedcom_setting(WT_GED_ID, 'WEBTREES_EMAIL', safe_POST('NEW_WEBTREES_EMAIL')); set_gedcom_setting(WT_GED_ID, 'WELCOME_TEXT_AUTH_MODE', safe_POST('NEW_WELCOME_TEXT_AUTH_MODE')); set_gedcom_setting(WT_GED_ID, 'WELCOME_TEXT_AUTH_MODE_'.WT_LOCALE, safe_POST('NEW_WELCOME_TEXT_AUTH_MODE_4', WT_REGEX_UNSAFE)); set_gedcom_setting(WT_GED_ID, 'WELCOME_TEXT_CUST_HEAD', safe_POST_bool('NEW_WELCOME_TEXT_CUST_HEAD')); set_gedcom_setting(WT_GED_ID, 'WORD_WRAPPED_NOTES', safe_POST_bool('NEW_WORD_WRAPPED_NOTES')); set_gedcom_setting(WT_GED_ID, 'ZOOM_BOXES', safe_POST('NEW_ZOOM_BOXES')); set_gedcom_setting(WT_GED_ID, 'title', safe_POST('gedcom_title', WT_REGEX_UNSAFE)); if (!$_POST["NEW_MEDIA_FIREWALL_ROOTDIR"]) { $NEW_MEDIA_FIREWALL_ROOTDIR = $INDEX_DIRECTORY; } else { $_POST["NEW_MEDIA_FIREWALL_ROOTDIR"] = trim(str_replace('\\','/',$_POST["NEW_MEDIA_FIREWALL_ROOTDIR"])); if (substr ($_POST["NEW_MEDIA_FIREWALL_ROOTDIR"], -1) != "/") $_POST["NEW_MEDIA_FIREWALL_ROOTDIR"] = $_POST["NEW_MEDIA_FIREWALL_ROOTDIR"] . "/"; $NEW_MEDIA_FIREWALL_ROOTDIR = safe_POST("NEW_MEDIA_FIREWALL_ROOTDIR"); } if (!is_dir($NEW_MEDIA_FIREWALL_ROOTDIR)) { $errors = true; $error_msg .= "".i18n::translate('The Media Firewall root directory you requested does not exist. You must create it first.')."
"; } if (!$errors) { // create the media directory // if NEW_MEDIA_FIREWALL_ROOTDIR is the INDEX_DIRECTORY, WT will have perms to create it // if WT is unable to create the directory, tell the user to create it if ($_POST["NEW_USE_MEDIA_FIREWALL"]==true) { if (!is_dir($NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY)) { @mkdir($NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY, WT_PERM_EXE); if (!is_dir($NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY)) { $errors = true; $error_msg .= "".i18n::translate('The protected media directory could not be created in the Media Firewall root directory. Please create this directory and make it world-writable.')." ".$NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY."
"; } } } } if (!$errors) { // create the thumbs dir to make sure we have write perms if ($_POST["NEW_USE_MEDIA_FIREWALL"]==true) { if (!is_dir($NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY."thumbs")) { @mkdir($NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY."thumbs", WT_PERM_EXE); if (!is_dir($NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY."thumbs")) { $errors = true; $error_msg .= "".i18n::translate('The protected media directory in the Media Firewall root directory is not world writable. ')." ".$NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY."
"; } } } } if (!$errors) { // copy the .htaccess file from INDEX_DIRECTORY to NEW_MEDIA_FIREWALL_ROOTDIR in case it is still in a web-accessible area if ($_POST["NEW_USE_MEDIA_FIREWALL"]==true) { if ((file_exists($INDEX_DIRECTORY.".htaccess")) && (is_dir($NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY)) && (!file_exists($NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY.".htaccess")) ) { @copy($INDEX_DIRECTORY.".htaccess", $NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY.".htaccess"); if (!file_exists($NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY.".htaccess")) { $errors = true; $error_msg .= "".i18n::translate('The protected media directory in the Media Firewall root directory is not world writable. ')." ".$NEW_MEDIA_FIREWALL_ROOTDIR.$MEDIA_DIRECTORY."
"; } } } } if (!$errors) { set_gedcom_setting(WT_GED_ID, 'MEDIA_FIREWALL_ROOTDIR', safe_POST('NEW_MEDIA_FIREWALL_ROOTDIR')); } if ($_POST["NEW_USE_MEDIA_FIREWALL"]==true ) { AddToLog("Media Firewall enabled", 'config'); if (!$errors) { // create/modify an htaccess file in the main media directory $httext = ""; if (file_exists($MEDIA_DIRECTORY.".htaccess")) { $httext = implode('', file($MEDIA_DIRECTORY.".htaccess")); // remove all WT media firewall sections from the .htaccess $httext = preg_replace('/\n?^[#]*\s*BEGIN WT MEDIA FIREWALL SECTION(.*\n){10}[#]*\s*END WT MEDIA FIREWALL SECTION\s*[#]*\n?/m', "", $httext); // comment out any existing lines that set ErrorDocument 404 $httext = preg_replace('/^(ErrorDocument\s*404(.*))\n?/', "#$1\n", $httext); $httext = preg_replace('/[^#](ErrorDocument\s*404(.*))\n?/', "\n#$1\n", $httext); } // add new WT media firewall section to the end of the file $httext .= "\n######## BEGIN WT MEDIA FIREWALL SECTION ##########"; $httext .= "\n################## DO NOT MODIFY ###################"; $httext .= "\n## THERE MUST BE EXACTLY 11 LINES IN THIS SECTION ##"; $httext .= "\n"; $httext .= "\n\tRewriteEngine On"; $httext .= "\n\tRewriteCond %{REQUEST_FILENAME} !-f"; $httext .= "\n\tRewriteCond %{REQUEST_FILENAME} !-d"; $httext .= "\n\tRewriteRule .* ".WT_SCRIPT_PATH."mediafirewall.php"." [L]"; $httext .= "\n"; $httext .= "\nErrorDocument\t404\t".WT_SCRIPT_PATH."mediafirewall.php"; $httext .= "\n########## END WT MEDIA FIREWALL SECTION ##########"; $whichFile = $MEDIA_DIRECTORY.".htaccess"; $fp = @fopen($whichFile, "wb"); if (!$fp) { $errors = true; $error_msg .= "".i18n::translate('E R R O R !!!
Could not write to file %s. Please check it for proper Write permissions.', $whichFile)."

"; } else { fwrite($fp, $httext); fclose($fp); chmod($whichFile, 0644); // Make sure apache can read this file } } } elseif ($_POST["NEW_USE_MEDIA_FIREWALL"]==false) { AddToLog("Media Firewall disabled", 'config'); if (file_exists($MEDIA_DIRECTORY.".htaccess")) { $httext = implode('', file($MEDIA_DIRECTORY.".htaccess")); // remove all WT media firewall sections from the .htaccess $httext = preg_replace('/\n?^[#]*\s*BEGIN WT MEDIA FIREWALL SECTION(.*\n){10}[#]*\s*END WT MEDIA FIREWALL SECTION\s*[#]*\n?/m', "", $httext); // comment out any lines that set ErrorDocument 404 $httext = preg_replace('/^(ErrorDocument\s*404(.*))\n?/', "#$1\n", $httext); $httext = preg_replace('/[^#](ErrorDocument\s*404(.*))\n?/', "\n#$1\n", $httext); $whichFile = $MEDIA_DIRECTORY.".htaccess"; $fp = @fopen($whichFile, "wb"); if (!$fp) { $errors = true; $error_msg .= "".i18n::translate('E R R O R !!!
Could not write to file %s. Please check it for proper Write permissions.', $whichFile)."

"; } else { fwrite($fp, $httext); fclose($fp); chmod($whichFile, 0644); // Make sure apache can read this file } } } if (!$errors) { $gednews = getUserNews(WT_GEDCOM); if (count($gednews)==0) { $news = array(); $news["title"] = i18n::translate('Welcome to Your Genealogy'); $news["username"] = WT_GEDCOM; $news["text"] = i18n::translate('The genealogy information on this website is powered by webtrees. This page provides an introduction and overview to this genealogy.

To begin working with the data, choose one of the charts from the Charts menu, go to the Individual list, or search for a name or place.

If you have trouble using the site, you can click on the Help icon to give you information on how to use the page that you are currently viewing.

Thank you for visiting this site.'); $news["date"] = client_time(); addNews($news); } header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.'editgedcoms.php'); exit; } } print_header(i18n::translate('GEDCOM configuration')); ?>
", i18n::translate('GEDCOM configuration'), " - "; echo PrintReady(get_gedcom_setting(WT_GED_ID, 'title')); echo ""; echo ""; echo i18n::translate('Return to the GEDCOM management menu'); echo "

"; ?>
".$error_msg."
"; $i = 0; ?>
', $person->getFullName(), ' ', $person->format_first_major_fact(WT_EVENTS_BIRT, 1), ''; } else { echo ' ', i18n::translate('Unable to find record with ID'), ''; } } ?>


i18n::translate('disable'),true=>i18n::translate('enable')), $HIDE_LIVE_PEOPLE, ''); ?>
', '' ); ?>

'; $rows=WT_DB::prepare( "SELECT default_resn_id, tag_type, xref, resn". " FROM `##default_resn`". " WHERE gedcom_id=?". " ORDER BY xref IS NULL, tag_type IS NULL, xref, tag_type" )->execute(array(WT_GED_ID))->fetchAll(); foreach ($rows as $row) { echo ''; } echo '
'; echo ''; print_findindi_link("xref",""); print_findfamily_link("xref"); print_findsource_link("xref"); print_findrepository_link("xref"); print_findmedia_link("xref", "1media"); echo ''; echo select_edit_control('tag_type', $all_tags, '', null, null); echo ''; echo select_edit_control('resn', $PRIVACY_CONSTANTS, null, 'privacy', null); echo ''; echo ''; echo ''; // value set by JS echo '
'; if ($row->xref) { $record=GedcomRecord::getInstance($row->xref); if ($record) { $name=$record->getFullName(); } else { $name=i18n::translate('this record does not exist'); } // I18N: e.g. John DOE (I1234) echo i18n::translate('%1$s (%2$s)', $name, $row->xref); } else { echo ' '; } echo ''; if ($row->tag_type) { // I18N: e.g. Marriage (MARR) echo i18n::translate('%1$s [%2$s]', translate_fact($row->tag_type), $row->tag_type); } else { echo ' '; } echo ''; echo $PRIVACY_CONSTANTS[$row->resn]; echo ''; echo ''; echo '
'; ?>
0) echo "".i18n::translate('Media path should not contain a drive letter; media may not be displayed.').""; ?>
" />
%s directory will be used.', $INDEX_DIRECTORY); ?>
i18n::translate('hide'),true=>i18n::translate('show')), get_gedcom_setting(WT_GED_ID, 'SHOW_CONTEXT_HELP')); ?>
i18n::translate('hide'),true=>i18n::translate('show')), $ALLOW_THEME_DROPDOWN); ?>
'; foreach ($row as $col) { echo ''; } echo ''; } ?>
'; if (is_null($col)) { echo ' '; } else { echo " "; echo translate_fact($col); } echo '
i18n::translate('hide'),true=>i18n::translate('show')), $SHOW_EMPTY_BOXES); ?>
i18n::translate('hide'),true=>i18n::translate('show')), $PEDIGREE_FULL_DETAILS); ?>
i18n::translate('hide'),true=>i18n::translate('show')), $PEDIGREE_SHOW_GENDER); ?>
i18n::translate('hide'),true=>i18n::translate('show')), $SHOW_PARENTS_AGE); ?>
i18n::translate('hide'),true=>i18n::translate('show')), $SHOW_LDS_AT_GLANCE); ?>
i18n::translate('hide'),true=>i18n::translate('show')), $SHOW_FACT_ICONS); ?>
i18n::translate('hide'),true=>i18n::translate('show')), $SHOW_AGE_DIFF); ?>
i18n::translate('hide'),true=>i18n::translate('show')), get_gedcom_setting(WT_GED_ID, 'SHOW_EST_LIST_DATES')); ?>
i18n::translate('hide'),true=>i18n::translate('show')), !$HIDE_GEDCOM_ERRORS); /* Note: name of object is reverse of description */ ?>
i18n::translate('hide'),true=>i18n::translate('show')), $SHOW_COUNTER); ?>
i18n::translate('hide'),true=>i18n::translate('show')), $SHOW_SPIDER_TAGLINE); ?>
i18n::translate('hide'),true=>i18n::translate('show')), $SHOW_STATS); ?>
i18n::translate('hide'),true=>i18n::translate('show')), $SHOW_LAST_CHANGE); ?>
i18n::translate('disable'),true=>i18n::translate('enable')), $ALLOW_EDIT_GEDCOM); ?>
i18n::translate_c('Surname tradition', 'paternal'), 'spanish'=>i18n::translate_c('Surname tradition', 'Spanish'), 'portuguese'=>i18n::translate_c('Surname tradition', 'Portuguese'), 'icelandic'=>i18n::translate_c('Surname tradition', 'Icelandic'), 'polish'=>i18n::translate_c('Surname tradition', 'Polish'), 'none'=>i18n::translate_c('Surname tradition', 'none')), null, get_gedcom_setting(WT_GED_ID, 'SURNAME_TRADITION')); ?>
i18n::translate('none'), 1=>i18n::translate('facts'), 2=>i18n::translate('records')), null, get_gedcom_setting(WT_GED_ID, 'PREFER_LEVEL2_SOURCES')); ?>
i18n::translate('disable'),true=>i18n::translate('enable')), get_gedcom_setting(WT_GED_ID, 'ENABLE_AUTOCOMPLETE')); ?>