Skip to content

Commit

Permalink
Fixed: The installer checks if the avatar and background directories …
Browse files Browse the repository at this point in the history
…are writable, but fails to check the file directory used for attachments.

Thanks brion

http://laconi.ca/trac/ticket/1703
  • Loading branch information
candrews committed Jul 21, 2009
1 parent a9613e9 commit 2246653
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
11 changes: 7 additions & 4 deletions README
Expand Up @@ -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:
Expand Down
21 changes: 10 additions & 11 deletions install.php
Expand Up @@ -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;
Expand Down

0 comments on commit 2246653

Please sign in to comment.