diff options
author | Sam Wilson <sam@samwilson.id.au> | 2015-01-16 10:53:12 +0800 |
---|---|---|
committer | Sam Wilson <sam@samwilson.id.au> | 2015-10-04 15:19:29 +0800 |
commit | b9c6d5a9279e014ca0cbee7f862196b44e9250db (patch) | |
tree | 602ff377a3a2d838d178f4d923173e321566eacd | |
parent | a194468bb5c99156bf9cb6e9272f98a52fb003fa (diff) | |
download | planet-b9c6d5a9279e014ca0cbee7f862196b44e9250db.tar planet-b9c6d5a9279e014ca0cbee7f862196b44e9250db.tar.gz planet-b9c6d5a9279e014ca0cbee7f862196b44e9250db.tar.bz2 planet-b9c6d5a9279e014ca0cbee7f862196b44e9250db.tar.xz planet-b9c6d5a9279e014ca0cbee7f862196b44e9250db.zip |
Update installation checks for now-nonexistant config files. Refs #69.
-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); |