Skip to content

Commit

Permalink
Bug 715045 - only modify media/.htaccess when media firewall is actua…
Browse files Browse the repository at this point in the history
…lly enabled or disabled
  • Loading branch information
ljm42 committed Feb 28, 2011
1 parent 4e5bf35 commit 2e78b71
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions admin_trees_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ function GetGEDFromZIP($zipfile, $extract=true) {
// 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 ($_POST["NEW_USE_MEDIA_FIREWALL"]==true && $USE_MEDIA_FIREWALL==false) {
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)) {
Expand All @@ -273,7 +273,7 @@ function GetGEDFromZIP($zipfile, $extract=true) {
}
if (!$errors) {
// create the thumbs dir to make sure we have write perms
if ($_POST["NEW_USE_MEDIA_FIREWALL"]==true) {
if ($_POST["NEW_USE_MEDIA_FIREWALL"]==true && $USE_MEDIA_FIREWALL==false) {
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")) {
Expand All @@ -285,7 +285,7 @@ function GetGEDFromZIP($zipfile, $extract=true) {
}
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 ($_POST["NEW_USE_MEDIA_FIREWALL"]==true && $USE_MEDIA_FIREWALL==false) {
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")) {
Expand All @@ -299,7 +299,7 @@ function GetGEDFromZIP($zipfile, $extract=true) {
set_gedcom_setting(WT_GED_ID, 'MEDIA_FIREWALL_ROOTDIR', safe_POST('NEW_MEDIA_FIREWALL_ROOTDIR'));
}

if ($_POST["NEW_USE_MEDIA_FIREWALL"]==true ) {
if ($_POST["NEW_USE_MEDIA_FIREWALL"]==true && $USE_MEDIA_FIREWALL==false) {
AddToLog("Media Firewall enabled", 'config');

if (!$errors) {
Expand Down Expand Up @@ -337,7 +337,7 @@ function GetGEDFromZIP($zipfile, $extract=true) {
chmod($whichFile, 0644); // Make sure apache can read this file
}
}
} elseif ($_POST["NEW_USE_MEDIA_FIREWALL"]==false) {
} elseif ($_POST["NEW_USE_MEDIA_FIREWALL"]==false && $USE_MEDIA_FIREWALL==true) {
AddToLog("Media Firewall disabled", 'config');

if (file_exists($MEDIA_DIRECTORY.".htaccess")) {
Expand Down Expand Up @@ -377,7 +377,7 @@ function GetGEDFromZIP($zipfile, $extract=true) {
}

print_header(WT_I18N::translate('Family tree configuration'));
if (get_gedcom_count()==1) { //Removed becasue it doesn't work here for multiple GEDCOMs. Can be reinstated when fixed (https://bugs.launchpad.net/webtrees/+bug/613235)
if (get_gedcom_count()==1) { //Removed because it doesn't work here for multiple GEDCOMs. Can be reinstated when fixed (https://bugs.launchpad.net/webtrees/+bug/613235)
if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm';
}

Expand Down

0 comments on commit 2e78b71

Please sign in to comment.