diff --git a/components/install/view.php b/components/install/view.php old mode 100755 new mode 100644 index 0829774..045aeb8 --- a/components/install/view.php +++ b/components/install/view.php @@ -3,7 +3,7 @@ /* * Copyright (c) Codiad & Kent Safranski (codiad.com), distributed -* as-is and without warranty under the MIT License. See +* as-is and without warranty under the MIT License. See * [root]/license.txt for more. This information must remain intact. */ @@ -14,17 +14,7 @@ $data = is_writable($path . "/data"); $conf = $path . '/config.php'; -if(!file_exists($conf) && !is_writable($path)) { - $config = false; -} elseif(!file_exists($conf) && is_writable($path)) { - $config = file_put_contents($conf, file_get_contents($path . "/config.example.php")); - if($config !== false) { - $config = true; - unlink($conf); - } -} elseif(file_exists($conf)) { - $config = is_writable($conf); -} +$config = is_writable(file_exists($conf) ? $conf : $path); if(ini_get('register_globals') == 1) { $register = true; @@ -40,7 +30,7 @@ if(!$workspace || !$data || !$config || $register){

[SYSTEM]/config.php - PASSED'; } else { echo 'ERROR'; } ?>

[SYSTEM]/workspace - PASSED'; } else { echo 'ERROR'; } ?>

-

[SYSTEM]/data - PASSED'; } else { echo 'ERROR'; } ?>

+

[SYSTEM]/data - PASSED'; } else { echo 'ERROR'; } ?>

Please make sure these environmental variables are set:

@@ -49,36 +39,36 @@ if(!$workspace || !$data || !$config || $register){ - +

Initial Setup

- + - + - -
- + +
+ - +
- -
- + +
+ - +
- +
- +
- + @@ -86,7 +76,7 @@ if(!$workspace || !$data || !$config || $register){
- + - + $(function(){ - + $('html, body').css('overflow', 'auto'); - + $('#install').on('submit',function(e){ e.preventDefault(); - + // Check empty fields - + empty_fields = false; $('input').each(function(){ if($(this).val()=='' && $(this).attr('name')!='path'){ empty_fields = true; } }); - + if(empty_fields){ alert('All fields must be filled out'); } - + // Check password password_match = true; if($('input[name="password"]').val()!=$('input[name="password_confirm"]').val()){ password_match = false; } - + // Check Path check_path = true; projectPath = ''; if($('input[name="project_path"]').length) { projectPath = $('input[name="project_path"]').val(); } - + if ( projectPath.indexOf("/") == 0 ) { check_path = confirm('Do you really want to create project with absolute path "' + projectPath + '"?'); - } - + } + if(!password_match){ alert('The passwords entered do not match'); } - + if(!empty_fields && password_match && check_path){ $.post('components/install/process.php',$('#install').serialize(),function(data){ if(data=='success'){ @@ -234,7 +224,7 @@ if(!$workspace || !$data || !$config || $register){ } }); } - + }); });