diff options
-rwxr-xr-x | install.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/install.php b/install.php index e0c23bd..cc539dd 100755 --- a/install.php +++ b/install.php @@ -8,9 +8,9 @@ function installStatus($str, $msg, $result) { return '<tr><td>' . $str . '</td><td class="' . $class . '">' . $msg . '</td></tr>'; } -// If the password and config files exist, moonmoon is already installed -if (file_exists(__DIR__ . '/custom/config.yml') - && file_exists(__DIR__ . '/admin/inc/pwd.inc.php')) { +// If the config file exists and the auth variables are set, moonmoon is already installed +include dirname(__FILE__) . '/admin/inc/pwd.inc.php'; +if (file_exists(dirname(__FILE__) . '/custom/config.yml') && isset($login) && isset($password)) { $status = 'installed'; } elseif (isset($_REQUEST['url'])) { $save = array(); @@ -56,9 +56,9 @@ if (file_exists(__DIR__ . '/custom/config.yml') '/cache', ); - // We now test that all required files are writable + // We now test that all required files and directories are writable. foreach ($tests as $v) { - if(is_writable(__DIR__ . $v)) { + if(touch(dirname(__FILE__) . $v)) { $strInstall .= installStatus("<code>$v</code> is writable", 'OK', true); } else { $strInstall .= installStatus("<code>$v</code> is writable", 'FAIL',false); |