]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fixed: The installer checks if the avatar and background directories are writable...
authorCraig Andrews <candrews@integralblue.com>
Tue, 21 Jul 2009 17:59:34 +0000 (13:59 -0400)
committerCraig Andrews <candrews@integralblue.com>
Tue, 21 Jul 2009 17:59:34 +0000 (13:59 -0400)
Thanks brion

http://laconi.ca/trac/ticket/1703

README
install.php

diff --git a/README b/README
index b65a08d425089728dd3d6236c3c8b3472a141cc4..0bf1319c6d4d4b1b0c0345b3f5168d566323ef2a 100644 (file)
--- a/README
+++ b/README
@@ -262,13 +262,16 @@ especially if you've previously installed PHP/MySQL packages.
    that user's default group instead. As a last resort, you can create
    a new group like "mublog" and add the Web server's user to the group.
 
-4. You should also take this moment to make your avatar subdirectory
-   writeable by the Web server. An insecure way to do this is:
+4. You should also take this moment to make your avatar, background, and
+   file subdirectories writeable by the Web server. An insecure way to do
+   this is:
 
          chmod a+w /var/www/mublog/avatar
+         chmod a+w /var/www/mublog/background
+         chmod a+w /var/www/mublog/file
 
-   You can also make the avatar directory writeable by the Web server
-   group, as noted above.
+   You can also make the avatar, background, and file directories
+   writeable by the Web server group, as noted above.
 
 5. Create a database to hold your microblog data. Something like this
    should work:
index bae296a350ab5925284b2a2cd1f20f64d5cefef5..1d3a531c5ac8c5ef984c3e71b26b1df85efbd8a1 100644 (file)
@@ -70,17 +70,16 @@ function checkPrereqs()
             $pass = false;
        }
 
-       if (!is_writable(INSTALLDIR.'/avatar/')) {
-         ?><p class="error">Cannot write avatar directory: <code><?php echo INSTALLDIR; ?>/avatar/</code></p>
-              <p>On your server, try this command: <code>chmod a+w <?php echo INSTALLDIR; ?>/avatar/</code></p>
-         <?
-            $pass = false;
-       }
-       if (!is_writable(INSTALLDIR.'/background/')) {
-         ?><p class="error">Cannot write background directory: <code><?php echo INSTALLDIR; ?>/background/</code></p>
-              <p>On your server, try this command: <code>chmod a+w <?php echo INSTALLDIR; ?>/background/</code></p>
-         <?
-            $pass = false;
+       // Check the subdirs used for file uploads
+       $fileSubdirs = array('avatar', 'background', 'file');
+       foreach ($fileSubdirs as $fileSubdir) {
+               $fileFullPath = INSTALLDIR."/$fileSubdir/";
+               if (!is_writable($fileFullPath)) {
+            ?><p class="error">Cannot write <?php echo $fileSubdir; ?> directory: <code><?php echo $fileFullPath; ?></code></p>
+                      <p>On your server, try this command: <code>chmod a+w <?php echo $fileFullPath; ?></code></p>
+            <?
+                    $pass = false;
+               }
        }
 
        return $pass;