From: jtate <jtate>
Date: Tue, 31 Oct 2006 14:21:58 +0000 (+0000)
Subject: Finally add support for detecting the "more secure" method of setting up s9y in upgra... 
X-Git-Tag: 1.0.3~8
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=56c067489bf669e385304a773ef2429d10b794a2;p=s9y.git

Finally add support for detecting the "more secure" method of setting up s9y in upgrade checks.  Nice that it took ten whole months to get around to adding this, huh?
---

diff --git a/include/admin/upgrader.inc.php b/include/admin/upgrader.inc.php
index 7f50dbd..c5010fa 100644
--- a/include/admin/upgrader.inc.php
+++ b/include/admin/upgrader.inc.php
@@ -273,8 +273,26 @@ if (($showAbort && $serendipity['GET']['action'] == 'ignore') || $serendipity['G
             if ( is_writable($basedir) ) {
                 echo serendipity_upgraderResultDiagnose(S9Y_U_SUCCESS, WRITABLE);
             } else {
-                echo serendipity_upgraderResultDiagnose(S9Y_U_ERROR, NOT_WRITABLE);
-                $showWritableNote = true;
+                $showWritableNote = false;
+                #Figure out if we're set up a little more securely
+                #PATH_SMARTY_COMPILE/
+                #uploads/
+                #archives/
+                #.htaccess
+                #serendipity_config_local.inc.php
+                # For completeness we could test to make sure the directories
+                # really are directories, but that's probably overkill
+                foreach (array('archives/', PATH_SMARTY_COMPILE . '/', 'uploads/', '.htaccess', 'serendipity_config_local.inc.php') as $path) {
+                    if (!is_writeable($basedir . $path)) {
+                        echo serendipity_upgraderResultDiagnose(S9Y_U_ERROR, NOT_WRITABLE);
+                        $showWritableNote = true;
+                        break;
+                    }
+                }
+
+                if (!$showWritableNote) {
+                    echo serendipity_upgraderResultDiagnose(S9Y_U_SUCCESS, WRITABLE);
+                }
             }
      ?></td>
     </tr>