Hotfix 5
This commit is contained in:
parent
f67d378bd9
commit
62a5d4c3d6
|
@ -14,6 +14,7 @@ if (!file_exists("runInstall.php")) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$populated = false;
|
$populated = false;
|
||||||
|
$userPopulated = false;
|
||||||
if (file_exists("../config.php")) {
|
if (file_exists("../config.php")) {
|
||||||
try {
|
try {
|
||||||
require('../config.php');
|
require('../config.php');
|
||||||
|
@ -26,10 +27,15 @@ if (file_exists("../config.php")) {
|
||||||
$configExist = true;
|
$configExist = true;
|
||||||
try{
|
try{
|
||||||
$connection = new PDO("mysql:host=$dbhostValue;dbname=$dbnameValue", $unameValue, $pwdValue,[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
|
$connection = new PDO("mysql:host=$dbhostValue;dbname=$dbnameValue", $unameValue, $pwdValue,[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
|
||||||
$populated = !empty($connection->prepare(str_replace("%PREFIX%", DB_PREFIX, "SELECT * FROM `%PREFIX%_dbversion`;"))->execute());
|
$stmt = $connection->prepare(str_replace("%PREFIX%", DB_PREFIX, "SELECT * FROM `%PREFIX%_dbversion`;"));
|
||||||
$userPopulated = !empty($connection->prepare(str_replace("%PREFIX%", DB_PREFIX, "SELECT * FROM `%PREFIX%_users`;"))->execute());
|
$query = $stmt->execute();
|
||||||
|
$populated = !empty($stmt->fetchAll(PDO::FETCH_ASSOC));
|
||||||
|
$stmt2 = $connection->prepare(str_replace("%PREFIX%", DB_PREFIX, "SELECT * FROM `%PREFIX%_users`;"));
|
||||||
|
$query2 = $stmt2->execute();
|
||||||
|
$userPopulated = !empty($stmt2->fetchAll(PDO::FETCH_ASSOC));
|
||||||
} catch (PDOException $e){
|
} catch (PDOException $e){
|
||||||
$populated = false;
|
$populated = false;
|
||||||
|
$userPopulated = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
@ -142,7 +148,7 @@ if(!is_cli()){
|
||||||
} else if ($configExist && !$populated) {
|
} else if ($configExist && !$populated) {
|
||||||
initDB();
|
initDB();
|
||||||
header("Location: install.php");
|
header("Location: install.php");
|
||||||
} else if ($populated && !$userPopulated) {
|
} else if ($populated && !$userPopulated && !in_array("5",$_POST)) {
|
||||||
?>
|
?>
|
||||||
<h1 class="screen-reader-text">Evviva!</h1>
|
<h1 class="screen-reader-text">Evviva!</h1>
|
||||||
<p>Hai <b>quasi terminato</b> l'installazione di Allerta, devi solo inserire alcune informazioni.</p>
|
<p>Hai <b>quasi terminato</b> l'installazione di Allerta, devi solo inserire alcune informazioni.</p>
|
||||||
|
|
|
@ -64,7 +64,7 @@ function checkConnection($host, $user, $password, $database, $return=false){
|
||||||
<summary>Informazioni avanzate</summary>
|
<summary>Informazioni avanzate</summary>
|
||||||
<pre><?php echo($e); ?></pre>
|
<pre><?php echo($e); ?></pre>
|
||||||
</details>
|
</details>
|
||||||
<p class="step"><a href="#" onclick="javascript:history.go(-1);return false;" class="button button-large">Riprova</a></p>
|
<p class="step"><a href="#" onclick="javascript:history.go(-2);return false;" class="button button-large">Riprova</a></p>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
exit();
|
exit();
|
||||||
|
@ -99,7 +99,7 @@ function checkConnection($host, $user, $password, $database, $return=false){
|
||||||
<summary>Informazioni avanzate</summary>
|
<summary>Informazioni avanzate</summary>
|
||||||
<pre><?php echo($e); ?></pre>
|
<pre><?php echo($e); ?></pre>
|
||||||
</details>
|
</details>
|
||||||
<p class="step"><a href="#" onclick="javascript:history.go(-1);return false;" class="button button-large">Riprova</a></p>
|
<p class="step"><a href="#" onclick="javascript:history.go(-2);return false;" class="button button-large">Riprova</a></p>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
exit();
|
exit();
|
||||||
|
@ -335,9 +335,7 @@ CREATE TABLE `".$prefix."_dbversion` (
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `Id` (`id`)
|
KEY `Id` (`id`)
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
)ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
INSERT INTO `".$prefix."_dbversion` (`id`, `version`, `timestamp`) VALUES (NULL, '1', current_timestamp()) WHERE NOT EXISTS (
|
INSERT INTO `".$prefix."_dbversion` (`version`, `timestamp`) VALUES('1', current_timestamp());");
|
||||||
SELECT version FROM `".$prefix."_dbversion` WHERE version = '1'
|
|
||||||
) LIMIT 1;");
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
if(is_cli()){
|
if(is_cli()){
|
||||||
echo($e);
|
echo($e);
|
||||||
|
|
Loading…
Reference in New Issue