Code Duplication    Length = 15-15 lines in 2 locations

install/cli-install.php 1 location

@@ 978-992 (lines=15) @@
975
}
976
977
// generate new site_id and set manager theme to default
978
if ($installMode == 0) {
979
    $siteid = uniqid('');
980
    mysqli_query($sqlParser->conn, "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')");
981
} else {
982
    // update site_id if missing
983
    $ds = mysqli_query($sqlParser->conn, "SELECT setting_name,setting_value FROM $dbase.`" . $table_prefix . "system_settings` WHERE setting_name='site_id'");
984
    if ($ds) {
985
        $r = mysqli_fetch_assoc($ds);
986
        $siteid = $r['setting_value'];
987
        if ($siteid == '' || $siteid = 'MzGeQ2faT4Dw06+U49x3') {
988
            $siteid = uniqid('');
989
            mysqli_query($sqlParser->conn, "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')");
990
        }
991
    }
992
}
993
994
// Reset database for installation of demo-site
995
if ($installData && $moduleSQLDataFile && $moduleSQLResetFile) {

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) {