Code Duplication    Length = 15-15 lines in 2 locations

install/cli-install.php 1 location

@@ 1049-1063 (lines=15) @@
1046
}
1047
1048
// generate new site_id and set manager theme to default
1049
if ($installMode == 0) {
1050
    $siteid = uniqid('');
1051
    mysqli_query($sqlParser->conn,
1052
        "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')");
1053
} else {
1054
    // update site_id if missing
1055
    $ds = mysqli_query($sqlParser->conn,
1056
        "SELECT setting_name,setting_value FROM $dbase.`" . $table_prefix . "system_settings` WHERE setting_name='site_id'");
1057
    if ($ds) {
1058
        $r = mysqli_fetch_assoc($ds);
1059
        $siteid = $r['setting_value'];
1060
        if ($siteid == '' || $siteid = 'MzGeQ2faT4Dw06+U49x3') {
1061
            $siteid = uniqid('');
1062
            mysqli_query($sqlParser->conn,
1063
                "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')");
1064
        }
1065
    }
1066
}

install/src/controllers/install.php 1 location

@@ 253-267 (lines=15) @@
250
}
251
252
// generate new site_id and set manager theme to default
253
if ($installMode == 0) {
254
    $siteid = uniqid('');
255
    mysqli_query($sqlParser->conn, "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')");
256
} else {
257
    // update site_id if missing
258
    $ds = mysqli_query($sqlParser->conn, "SELECT setting_name,setting_value FROM $dbase.`" . $table_prefix . "system_settings` WHERE setting_name='site_id'");
259
    if ($ds) {
260
        $r = mysqli_fetch_assoc($ds);
261
        $siteid = $r['setting_value'];
262
        if ($siteid == '' || $siteid = 'MzGeQ2faT4Dw06+U49x3') {
263
            $siteid = uniqid('');
264
            mysqli_query($sqlParser->conn, "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')");
265
        }
266
    }
267
}
268
269
// Reset database for installation of demo-site
270
if ($installData && $moduleSQLDataFile && $moduleSQLResetFile) {