Code Duplication    Length = 6-10 lines in 3 locations

install/install.queries.php 3 locations

@@ 692-701 (lines=10) @@
689
                            `item_id` int(12) NOT NULL
690
                           ) CHARSET=utf8;"
691
                        );
692
                    } elseif ($task == "restriction_to_roles") {
693
                        $mysqli_result = mysqli_query(
694
                            $dbTmp,
695
                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."restriction_to_roles` (
696
                            `role_id` int(12) NOT NULL,
697
                            `item_id` int(12) NOT NULL,
698
                            KEY `role_id_idx`  (`role_id`)
699
                            ) CHARSET=utf8;"
700
                        );
701
                    } elseif ($task === "languages") {
702
                        $mysqli_result = mysqli_query(
703
                            $dbTmp,
704
                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."languages` (
@@ 913-918 (lines=6) @@
910
911
                        // check that API doesn't exist
912
                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `".$var['tbl_prefix']."users` WHERE id = '".API_USER_ID."'"));
913
                        if ($tmp == 0) {
914
                            $mysqli_result = mysqli_query(
915
                                $dbTmp,
916
                                "INSERT INTO `".$var['tbl_prefix']."users` (`id`, `login`, `pw`, `groupes_visibles`, `derniers`, `key_tempo`, `last_pw_change`, `last_pw`, `admin`, `fonction_id`, `groupes_interdits`, `last_connexion`, `gestionnaire`, `email`, `favourites`, `latest_items`, `personal_folder`) VALUES ('".API_USER_ID."', 'API', '', '', '', '', '', '', '1', '', '', '', '0', '', '', '', '0')"
917
                            );
918
                        }
919
920
                        // check that OTV doesn't exist
921
                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `".$var['tbl_prefix']."users` WHERE id = '".OTV_USER_ID."'"));
@@ 922-927 (lines=6) @@
919
920
                        // check that OTV doesn't exist
921
                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `".$var['tbl_prefix']."users` WHERE id = '".OTV_USER_ID."'"));
922
                        if ($tmp == 0) {
923
                            $mysqli_result = mysqli_query(
924
                                $dbTmp,
925
                                "INSERT INTO `".$var['tbl_prefix']."users` (`id`, `login`, `pw`, `groupes_visibles`, `derniers`, `key_tempo`, `last_pw_change`, `last_pw`, `admin`, `fonction_id`, `groupes_interdits`, `last_connexion`, `gestionnaire`, `email`, `favourites`, `latest_items`, `personal_folder`) VALUES ('".OTV_USER_ID."', 'OTV', '', '', '', '', '', '', '1', '', '', '', '0', '', '', '', '0')"
926
                            );
927
                        }
928
                    }
929
                }
930
                // answer back