From b9c6d5a9279e014ca0cbee7f862196b44e9250db Mon Sep 17 00:00:00 2001 From: Sam Wilson Date: Fri, 16 Jan 2015 10:53:12 +0800 Subject: Update installation checks for now-nonexistant config files. Refs #69. --- install.php | 10 +++++----- 1 file 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 '' . $str . '' . $msg . ''; } -// 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("$v is writable", 'OK', true); } else { $strInstall .= installStatus("$v is writable", 'FAIL',false); -- cgit v1.2.1