$errors = array();
$successes = array();
+$final = false;
+
require_once('install_functions.php');
if (isset($_GET['clean'])) {
if (is_dir('install')){
- delTree('install');
- header('Location: index.php');
+ delTree('install');
+ header('Location: index.php');
+ }
+ if (is_dir('cache')) {
+ delTree('cache', false);
+ header('Location: index.php');
}
}
$errors[] = 'You must install twig before.';
} else {
$continue = true;
- $final = false;
$salt = generate_salt();
$content = file_get_contents('inc/poche/config.inc.default.php');
if ($_POST['db_engine'] == 'sqlite') {
if (!copy('install/poche.sqlite', 'db/poche.sqlite')) {
- $errors[] = 'Impossible to create the SQLite database file.';
+ $errors[] = 'Impossible to create the SQLite database file. Please check your file permissions.';
}
else {
$db_path = 'sqlite:' . realpath('') . '/db/poche.sqlite';
$handle = new PDO($db_path, $_POST['mysql_user'], $_POST['mysql_password'], array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4',
));
+ $content = str_replace("define ('MYSQL_USE_UTF8MB4', FALSE);", "define ('MYSQL_USE_UTF8MB4', TRUE);", $content);
} else { // regular UTF8
$db_path = 'mysql:host=' . $_POST['mysql_server'] . ';dbname=' . $_POST['mysql_database'];
$handle = new PDO($db_path, $_POST['mysql_user'], $_POST['mysql_password']);
}
}
}
+
+ $usertest = executeQuery($handle,"SELECT * from users WHERE username = ?", array($username));
+ if (!empty($usertest)) {
+ $continue = false;
+ $errors[] = "An user already exists with this username in database.";
+ }
+
+
if ($continue) {
$sql = "INSERT INTO users (username, password, name, email) VALUES (?, ?, ?, '')";
$params = array($username, $salted_password, $username);
if (!copy('inc/poche/config.inc.default.php', 'inc/poche/config.inc.php')) {
- $errors[] = 'Installation aborted, impossible to create inc/poche/config.inc.php file. Maybe you don\'t have write access to create it.';
+ $errors[] = 'Installation aborted, impossible to create inc/poche/config.inc.php file. Maybe you don\'t have write access to create it. Check your file permissions.';
} else {
if ($_POST['db_engine'] != 'sqlite') {
$content = str_replace("define ('STORAGE', 'sqlite');", "define ('STORAGE', '".$_POST['db_engine']."');", $content);
<?php if (file_exists('inc/poche/config.inc.php') && is_dir('vendor')) : ?>
<div class='messages success install'>
<p>
- wallabag seems already installed. If you want to update it, you only have to delete install folder, then <a href="index.php">reload this page</a>.
+ <a href="index.php?clean=0">Click here to finish update.</a><br>
+ If it fails, check your file permissions or just delete the install directory.
</p>
+ <p>You may have to clear cache (by going into config screen) after update.</p>
</div>
<?php endif; ?>
<?php endif; ?>
<tr class="<?php echo ($status['allow_url_fopen']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen">allow_url_fopen</a></td>
<td>Enabled</td>
- <?php echo ($status['allow_url_fopen']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
- <td><?php echo ($status['allow_url_fopen']) ? '<strong>allow_url_fopen:</strong> You have allow_url_fopen enabled.' : '<strong>allow_url_fopen:</strong> Your PHP configuration has allow_url_fopen disabled. <strong>' . $status['app_name'] . ' will not work here.</strong>' ?></td>
+ <?php if ($status['allow_url_fopen']) { ?>
+ <td class="good">Enabled</td>
+ <td><strong>allow_url_fopen:</strong> You have allow_url_fopen enabled.
+ <?php } elseif ($status['curl']) { ?>
+ <td class="pass">Disabled</td>
+ <td><strong>allow_url_fopen</strong> is disabled, but curl is supported, so it should be ok.</td>
+ <?php } else { ?>
+ <td class="bad">Disabled</td>
+ <td><strong>allow_url_fopen:</strong> Your PHP configuration has allow_url_fopen disabled.
+ <strong><?php echo $status['app_name']; ?> will not work here.</strong><?php } ?></td>
</tr>
<tr class="<?php echo ($status['gettext']) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/manual/en/book.gettext.php">gettext</a></td>
$(".database_info").hide();
$(".usersettings").hide();
<?php endif ?>
+
/*
* Database showing/hiding
*/
endif;
?>
+ <?php if (file_exists('inc/poche/config.inc.php') && is_dir('vendor')) : ?>
+ $('.technical').hide();
+ <?php endif ?>
+
$("#mysql_utf8_mb4").click(function() {
$("#utf8_mb4_infos").toggle();
});