Code Duplication    Length = 5-5 lines in 4 locations

install/install.queries.php 4 locations

@@ 1028-1032 (lines=5) @@
1025
                        )
1026
                    );
1027
                    fclose($fh);
1028
                    if ($result === false) {
1029
                        echo '[{"error" : "Setting.php file could not be created. Please check the path and the rights", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1030
                    } else {
1031
                        echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1032
                    }
1033
                } elseif ($task === "sk.php") {
1034
//Create sk.php file
1035
                    if (file_exists($skFile)) {
@@ 1060-1064 (lines=5) @@
1057
                    fclose($fh);
1058
1059
                    // finalize
1060
                    if ($result === false) {
1061
                        echo '[{"error" : "sk.php file could not be created. Please check the path and the rights.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1062
                    } else {
1063
                        echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1064
                    }
1065
                } elseif ($task === "security") {
1066
                    # Sort out the file permissions
1067
@@ 1080-1084 (lines=5) @@
1077
                        }
1078
                    }
1079
1080
                    if ($result === false) {
1081
                        echo '[{"error" : "Cannot change directory permissions - please fix manually", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1082
                    } else {
1083
                        echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1084
                    }
1085
                } elseif ($task === "teampass-seckey") {
1086
                    // create teampass-seckey.txt
1087
                    require_once '../includes/libraries/Encryption/Encryption/Crypto.php';
@@ 1173-1177 (lines=5) @@
1170
                    $result = mysqli_query($dbTmp, "DROP TABLE `_install`");
1171
                    $errorMsg = "Cannot remove `_install` table. Please do it manually.";
1172
1173
                    if ($result === false) {
1174
                        echo '[{"error" : "'.$errorMsg.'", "index" : "'.$post_index.'", "result" : "", "multiple" : ""}]';
1175
                    } else {
1176
                        echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1177
                    }
1178
                }
1179
            }
1180
            // delete install table