Skip to content

Commit

Permalink
2.1.27
Browse files Browse the repository at this point in the history
Fix for #1892 (remove install/ on upgrade)
  • Loading branch information
nilsteampassnet committed Sep 7, 2017
1 parent 746da27 commit 3d62cd6
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions install/upgrade_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
$post_no_previous_sk = filter_input(INPUT_POST, 'no_previous_sk', FILTER_SANITIZE_STRING);
$post_session_salt = filter_input(INPUT_POST, 'session_salt', FILTER_SANITIZE_STRING);
$post_previous_sk = filter_input(INPUT_POST, 'previous_sk', FILTER_SANITIZE_STRING);
$post_tbl_prefix = filter_input(INPUT_POST, 'tbl_prefix', FILTER_SANITIZE_STRING);
$post_no_maintenance_mode = filter_input(INPUT_POST, 'no_maintenance_mode', FILTER_SANITIZE_STRING);
$post_prefix_before_convert = filter_input(INPUT_POST, 'prefix_before_convert', FILTER_SANITIZE_STRING);
$post_sk_path = filter_input(INPUT_POST, 'sk_path', FILTER_SANITIZE_STRING);
Expand Down Expand Up @@ -542,7 +541,7 @@ function tableExists($tablename)
// no old sk is available
$tmp = mysqli_num_rows(mysqli_query(
$db_link,
"SELECT * FROM `".$var['tbl_prefix']."misc`
"SELECT * FROM `".$pre."misc`
WHERE type = 'admin' AND intitule = 'saltkey_ante_2127'"
));
if ($tmp == 0) {
Expand All @@ -566,12 +565,12 @@ function tableExists($tablename)
//What CPM version
if (mysqli_query(
$db_link,
"SELECT valeur FROM ".$post_tbl_prefix."misc
"SELECT valeur FROM ".$pre."misc
WHERE type='admin' AND intitule = 'cpassman_version'"
)) {
$tmpResult = mysqli_query(
$db_link,
"SELECT valeur FROM ".$post_tbl_prefix."misc
"SELECT valeur FROM ".$pre."misc
WHERE type='admin' AND intitule = 'cpassman_version'"
);
$cpmVersion = mysqli_fetch_row($tmpResult);
Expand All @@ -585,15 +584,15 @@ function tableExists($tablename)
if (@mysqli_fetch_row(
mysqli_query(
$db_link,
"SELECT valeur FROM ".$post_tbl_prefix."misc
"SELECT valeur FROM ".$pre."misc
WHERE type='admin' AND intitule = 'utf8_enabled'"
)
)
) {
$cpmIsUTF8 = mysqli_fetch_row(
mysqli_query(
$db_link,
"SELECT valeur FROM ".$post_tbl_prefix."misc
"SELECT valeur FROM ".$pre."misc
WHERE type='admin' AND intitule = 'utf8_enabled'"
)
);
Expand Down Expand Up @@ -836,6 +835,13 @@ function tableExists($tablename)
echo 'document.getElementById("step5_skFile").innerHTML = '.
'"<img src=\"images/tick.png\">";';
}

// Mark a tag to force Install stuff (folders, files and table) to be cleanup while first login
mysqli_query(
$db_link,
"INSERT INTO `".$pre."misc` (`type`, `intitule`, `valeur`) VALUES ('install', 'clear_install_folder', 'true')"
);


//Finished
if ($result1 !== false
Expand Down

0 comments on commit 3d62cd6

Please sign in to comment.