<tr>
<td><?php echo $basedir ?></td>
<td width="200"><?php
+ $basewritable = False;
if ( is_writable($basedir) ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
+ $basewritable = True;
} else {
- echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
- $showWritableNote = true;
+ #Figure out if we already have all we need
+ #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_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE . $path);
+ $showWritableNote = true;
+ break;
+ }
+ }
+ if (!$showWritableNote) {
+ echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
+ }
}
?></td>
</tr>
if ( is_writable($basedir . PATH_SMARTY_COMPILE) ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
} else {
- echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
- $showWritableNote = true;
+ if ($basewritable) {
+ echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
+ #This directory will be created later in the process
+ } else {
+ echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
+ $showWritableNote = true;
+ }
+ }
+ ?></td>
+ </tr>
+ <tr>
+ <td><?php echo $basedir . 'archives/'?></td>
+ <td width="200"><?php
+ if ( is_writable($basedir . 'archives/') ) {
+ echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
+ } else {
+ if ($basewritable) {
+ echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
+ #This directory will be created later in the process
+ } else {
+ echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
+ $showWritableNote = true;
+ }
}
?></td>
</tr>
if ( is_writable($basedir . 'uploads/') ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
} else {
- echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
- $showWritableNote = true;
+ if ($basewritable) {
+ echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
+ #This directory will be created later in the process
+ } else {
+ echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
+ $showWritableNote = true;
+ }
}
?></td>
</tr>
if (!is_dir($_POST['serendipityPath'])) {
$errs[] = sprintf(DIRECTORY_NON_EXISTANT, $_POST['serendipityPath']);
}
+ /* This test has already been passed on the diagnosis page. Besides
+ it's a partially bogus test.
elseif (!is_writable($_POST['serendipityPath']) ) {
$errs[] = sprintf(DIRECTORY_WRITE_ERROR, $_POST['serendipityPath']);
- }
+ }*/
elseif (!is_dir($_POST['serendipityPath'] . $_POST['uploadPath'] ) && @mkdir($_POST['serendipityPath'] . $_POST['uploadPath'], $umask) !== true) {
$errs[] = sprintf(DIRECTORY_CREATE_ERROR, $_POST['serendipityPath'] . $_POST['uploadPath']);
}
// Attempt to create the template compile directory, it might already be there, but we just want to be sure
if (!is_dir($_POST['serendipityPath'] . PATH_SMARTY_COMPILE) && @mkdir($_POST['serendipityPath'] . PATH_SMARTY_COMPILE, $umask) !== true) {
- $errs[] = sprintf(DIRECTORY_CREATE_ERROR, $_POST['serendipityPath'] . PATH_ARCHIVES);
+ $errs[] = sprintf(DIRECTORY_CREATE_ERROR, $_POST['serendipityPath'] . PATH_SMARTY_COMPILE);
$errs[] = sprintf(DIRECTORY_RUN_CMD , 'mkdir' , $_POST['serendipityPath'] . PATH_SMARTY_COMPILE);
$errs[] = sprintf(DIRECTORY_RUN_CMD , 'chmod go+rwx', $_POST['serendipityPath'] . PATH_SMARTY_COMPILE);
} elseif (is_dir($_POST['serendipityPath'] . PATH_SMARTY_COMPILE) && !is_writeable($_POST['serendipityPath'] . PATH_SMARTY_COMPILE) && @chmod($_POST['serendipityPath'] . PATH_SMARTY_COMPILE, $umask) !== true) {
define('S9Y_CONFIG_TEMPLATE', S9Y_INCLUDE_PATH . 'include/tpl/config_local.inc.php');
define('S9Y_CONFIG_USERTEMPLATE', S9Y_INCLUDE_PATH . 'include/tpl/config_personal.inc.php');
-define('IS_installed', file_exists('serendipity_config_local.inc.php'));
+define('IS_installed', file_exists('serendipity_config_local.inc.php') && (filesize('serendipity_config_local.inc.php') > 0));
if (IS_installed === true && !defined('IN_serendipity')) {
define('IN_serendipity', true);