From 69c2e86d1b8c4edc59b46d97eecc6d3bbe841e27 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sun, 25 Aug 2019 13:20:29 +0100 Subject: [PATCH] Settings file now in data dir for GitHub Manager --- lib/github-manager.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/github-manager.php b/lib/github-manager.php index 761b831..a75f283 100644 --- a/lib/github-manager.php +++ b/lib/github-manager.php @@ -48,9 +48,9 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset $settingsContents = substr($settingsContents,0,$repPosStart).$settingsNew.substr($settingsContents,$repPosEnd,strlen($settingsContents)); // Now update the config file - if (is_writeable($settingsFile)) { - $fh = fopen($settingsFile, 'w'); - fwrite($fh, $settingsContents); + if (is_writeable("../data/".$settingsFile)) { + $fh = fopen("../data/".$settingsFile, 'w'); + fwrite($fh, "../data/".$settingsContents); fclose($fh); // Clear any FTP session we may have @@ -59,7 +59,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset // Hide this popup and reload file manager echo ""; } else { - echo ""; + echo ""; } } @@ -151,16 +151,16 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset $settingsContents = substr($settingsContents,0,$repPosStart).$settingsNew.substr($settingsContents,$repPosEnd,strlen($settingsContents)); // Now update the config file - if (is_writeable($settingsFile)) { - $fh = fopen($settingsFile, 'w'); - fwrite($fh, $settingsContents); + if (is_writeable("../data/".$settingsFile)) { + $fh = fopen("../data/".$settingsFile, 'w'); + fwrite($fh, "../data/".$settingsContents); fclose($fh); // Finally, reload the iFrame screen for the user header("Location: github-manager.php?updatedGithubPaths&csrf=".$_SESSION["csrf"]); echo ""; die($t['saving github paths']); } else { - echo ""; + echo ""; } } }