Code Duplication    Length = 5-5 lines in 4 locations

install/install.queries.php 4 locations

@@ 1003-1007 (lines=5) @@
1000
                        )
1001
                    );
1002
                    fclose($fh);
1003
                    if ($result === false) {
1004
                        echo '[{"error" : "Setting.php file could not be created. Please check the path and the rights", "result":"", "index" : "'.$_POST['index'].'", "multiple" : "'.$_POST['multiple'].'"}]';
1005
                    } else {
1006
                        echo '[{"error" : "", "index" : "'.$_POST['index'].'", "multiple" : "'.$_POST['multiple'].'"}]';
1007
                    }
1008
                } elseif ($task === "sk.php") {
1009
//Create sk.php file
1010
                    if (file_exists($skFile)) {
@@ 1035-1039 (lines=5) @@
1032
                    fclose($fh);
1033
1034
                    // finalize
1035
                    if ($result === false) {
1036
                        echo '[{"error" : "sk.php file could not be created. Please check the path and the rights.", "result":"", "index" : "'.$_POST['index'].'", "multiple" : "'.$_POST['multiple'].'"}]';
1037
                    } else {
1038
                        echo '[{"error" : "", "index" : "'.$_POST['index'].'", "multiple" : "'.$_POST['multiple'].'"}]';
1039
                    }
1040
                } elseif ($task === "security") {
1041
                    # Sort out the file permissions
1042
@@ 1055-1059 (lines=5) @@
1052
                        }
1053
                    }
1054
1055
                    if ($result === false) {
1056
                        echo '[{"error" : "Cannot change directory permissions - please fix manually", "result":"", "index" : "'.$_POST['index'].'", "multiple" : "'.$_POST['multiple'].'"}]';
1057
                    } else {
1058
                        echo '[{"error" : "", "index" : "'.$_POST['index'].'", "multiple" : "'.$_POST['multiple'].'"}]';
1059
                    }
1060
                } elseif ($task === "teampass-seckey") {
1061
                    // create teampass-seckey.txt
1062
                    require_once '../includes/libraries/Encryption/Encryption/Crypto.php';
@@ 1148-1152 (lines=5) @@
1145
                    $result = mysqli_query($dbTmp, "DROP TABLE `_install`");
1146
                    $errorMsg = "Cannot remove `_install` table. Please do it manually.";
1147
1148
                    if ($result === false) {
1149
                        echo '[{"error" : "'.$errorMsg.'", "index" : "'.$_POST['index'].'", "result" : "", "multiple" : ""}]';
1150
                    } else {
1151
                        echo '[{"error" : "", "index" : "'.$_POST['index'].'", "multiple" : "'.$_POST['multiple'].'"}]';
1152
                    }
1153
                }
1154
            }
1155
            // delete install table