Code Duplication    Length = 15-15 lines in 2 locations

install/instprocessor.php 1 location

@@ 271-285 (lines=15) @@
268
}
269
270
// generate new site_id and set manager theme to default
271
if ($installMode == 0) {
272
    $siteid = uniqid('');
273
    mysqli_query($sqlParser->conn, "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')");
274
} else {
275
    // update site_id if missing
276
    $ds = mysqli_query($sqlParser->conn, "SELECT setting_name,setting_value FROM $dbase.`" . $table_prefix . "system_settings` WHERE setting_name='site_id'");
277
    if ($ds) {
278
        $r = mysqli_fetch_assoc($ds);
279
        $siteid = $r['setting_value'];
280
        if ($siteid == '' || $siteid = 'MzGeQ2faT4Dw06+U49x3') {
281
            $siteid = uniqid('');
282
            mysqli_query($sqlParser->conn, "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')");
283
        }
284
    }
285
}
286
287
// Reset database for installation of demo-site
288
if ($installData && $moduleSQLDataFile && $moduleSQLResetFile) {

install/cli-install.php 1 location

@@ 994-1008 (lines=15) @@
991
}
992
993
// generate new site_id and set manager theme to default
994
if ($installMode == 0) {
995
    $siteid = uniqid('');
996
    mysqli_query($sqlParser->conn, "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')");
997
} else {
998
    // update site_id if missing
999
    $ds = mysqli_query($sqlParser->conn, "SELECT setting_name,setting_value FROM $dbase.`" . $table_prefix . "system_settings` WHERE setting_name='site_id'");
1000
    if ($ds) {
1001
        $r = mysqli_fetch_assoc($ds);
1002
        $siteid = $r['setting_value'];
1003
        if ($siteid == '' || $siteid = 'MzGeQ2faT4Dw06+U49x3') {
1004
            $siteid = uniqid('');
1005
            mysqli_query($sqlParser->conn, "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')");
1006
        }
1007
    }
1008
}
1009
1010
// Reset database for installation of demo-site
1011
if ($installData && $moduleSQLDataFile && $moduleSQLResetFile) {