diff options
author | Pascal Chevrel <pascal@chevrel.org> | 2012-03-08 11:49:38 +0100 |
---|---|---|
committer | Pascal Chevrel <pascal@chevrel.org> | 2012-03-08 11:49:38 +0100 |
commit | 60b537a088b2052896447a078948748ea43084a6 (patch) | |
tree | 537418ccbda4d78eb3312795b84d92b43aaeab3c /install.php | |
parent | 41ec00699d5f86cc868984600d3676821caed83f (diff) | |
download | planet-60b537a088b2052896447a078948748ea43084a6.tar planet-60b537a088b2052896447a078948748ea43084a6.tar.gz planet-60b537a088b2052896447a078948748ea43084a6.tar.bz2 planet-60b537a088b2052896447a078948748ea43084a6.tar.xz planet-60b537a088b2052896447a078948748ea43084a6.zip |
fix install process and admin section which are currently broken because of the separation of classes in separate files. Now the files calling those classes are including app/app.php, also, I changed the variable name in the installation wizard to so as to avoid confusion with already used in the admin section
Diffstat (limited to 'install.php')
-rwxr-xr-x[-rw-r--r--] | install.php | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/install.php b/install.php index 06ffc5c..eaf736a 100644..100755 --- a/install.php +++ b/install.php @@ -1,5 +1,5 @@ <?php -include (dirname(__FILE__).'/app/classes/Planet.class.php'); +require_once dirname(__FILE__) . '/app/app.php'; define('CONFIG_FILE', dirname(__FILE__).'/custom/config.yml'); define('PWD_FILE', dirname(__FILE__).'/admin/inc/pwd.inc.php'); @@ -12,7 +12,7 @@ if (file_exists(CONFIG_FILE) && file_exists(PWD_FILE)) { $status = 'installed'; } elseif (isset($_REQUEST['url'])) { $save = Array(); - + //Save config file $config = Array( 'url' => $_REQUEST['url'], @@ -25,12 +25,12 @@ if (file_exists(CONFIG_FILE) && file_exists(PWD_FILE)) { 'postmaxlength' => 0, 'cachedir' => './cache' ); - $planet_config = new PlanetConfig($config); - $save['config'] = file_put_contents(dirname(__FILE__).'/custom/config.yml', $planet_config->toYaml()); - + $CreatePlanetConfig = new PlanetConfig($config); + $save['config'] = file_put_contents(dirname(__FILE__).'/custom/config.yml', $CreatePlanetConfig->toYaml()); + //Save password $save['password'] = file_put_contents(dirname(__FILE__).'/admin/inc/pwd.inc.php', '<?php $login="admin"; $password="'.md5($_REQUEST['password']).'"; ?>'); - + if (0 != ($save['config'] + $save['password'])) { $status = 'installed'; } @@ -64,8 +64,8 @@ if (file_exists(CONFIG_FILE) && file_exists(PWD_FILE)) { 'label' => '<code>./cache</code> is writable', 'solution' => 'Make <code>./cache</code> writable with CHMOD' ), - );
-
+ ); + foreach ($tests as $k => $v) { // test file requirements, exclude php5 test if ($tests[$k]['file']) { @@ -91,7 +91,7 @@ if (file_exists(CONFIG_FILE) && file_exists(PWD_FILE)) { $strRecommendation .= '<li>'.$test['solution'].'</li>'; } } - + if ($bInstallOk) { $status = 'install'; } else { @@ -113,12 +113,12 @@ header('Content-type: text/html; charset=UTF-8'); body { font: normal 1em sans-serif; } - + .section { width: 500px; margin: 0 auto; } - + /* Error */ span.ok { color: #090; @@ -130,16 +130,16 @@ header('Content-type: text/html; charset=UTF-8'); th { text-align: left; } - + /* Install */ .field label { display: block; } - + .submit { font-size: 2em; } - + /* Installed */ </style> </head> @@ -147,11 +147,11 @@ header('Content-type: text/html; charset=UTF-8'); <body> <div class="section"> <h1>moonmoon installation</h1> - + <?php if ('error' == $status) : ?> <div id="compatibility"> <h2>Sorry, your server is not compatible with moonmoon.</h2> - + <h3>Your server does not fulfill the requirements</h3> <table> <thead> @@ -164,14 +164,14 @@ header('Content-type: text/html; charset=UTF-8'); <?php echo $strInstall ?> </tbody> </table> - + <h3>Troubleshooting</h3> <p>To install moonmoon, try the following changes:</p> <ul> <ul><?php echo $strRecommendation; ?></ul> </ul> </div> - + <?php elseif ('install' == $status) : ?> <div> <form method="post" action=""> @@ -182,7 +182,7 @@ header('Content-type: text/html; charset=UTF-8'); document.forms[0].elements[1].value = document.URL.replace('install.php',''); --> </script> - + <p class="field"> <label for="title">Title:</label> <input type="text" id="title" name="title" value="My website"/> @@ -202,9 +202,9 @@ header('Content-type: text/html; charset=UTF-8'); </fieldset> </form> </div> - + <?php elseif ('installed' == $status): ?> - + <p>Congratulations! Your moonmoon is ready.</p> <h3>What's next?</h3> <ol> @@ -212,7 +212,7 @@ header('Content-type: text/html; charset=UTF-8'); <strong>Delete</strong> <code>install.php</code> with your FTP software. </li> <li> - Use your password to go to the + Use your password to go to the <a href="./admin/">administration panel</a> </li> </ol> |