Subversion Repositories oidplus

Rev

Rev 1363 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1363 Rev 1452
Line 613... Line 613...
613
                                                array($row["id"]??null,
613
                                                array($row["id"]??null,
614
                                                        $row["parent"]??null,
614
                                                        $row["parent"]??null,
615
                                                        $row["title"]??null,
615
                                                        $row["title"]??null,
616
                                                        $row["description"]??null,
616
                                                        $row["description"]??null,
617
                                                        $row["ra_email"]??null,
617
                                                        $row["ra_email"]??null,
618
                                                        $row["confidential"]??false,
618
                                                        (bool)($row["confidential"]??false),
619
                                                        $row["created"]??null,
619
                                                        $row["created"]??'1900-01-01 00:00:00',
620
                                                        $row["updated"]??null,
620
                                                        $row["updated"]??'1900-01-01 00:00:00',
621
                                                        $row["comment"]??null)
621
                                                        $row["comment"]??null)
622
                                        );
622
                                        );
623
 
623
 
624
                                        foreach (($row["asn1ids"]??[]) as $row2) {
624
                                        foreach (($row["asn1ids"]??[]) as $row2) {
625
                                                $num_rows["asn1id"]++;
625
                                                $num_rows["asn1id"]++;
626
                                                OIDplus::db()->query("insert into ###asn1id (oid, name, standardized, well_known) values (?, ?, ?, ?)",
626
                                                OIDplus::db()->query("insert into ###asn1id (oid, name, standardized, well_known) values (?, ?, ?, ?)",
627
                                                        array($row["id"]??null, // sic: $row, not $row2
627
                                                        array($row["id"]??null, // sic: $row, not $row2
628
                                                                $row2["name"]??null,
628
                                                                $row2["name"]??null,
629
                                                                $row2["standardized"]??false,
629
                                                                (bool)($row2["standardized"]??false),
630
                                                                $row2["well_known"]??false)
630
                                                                (bool)($row2["well_known"]??false))
631
                                                );
631
                                                );
632
                                        }
632
                                        }
633
 
633
 
634
                                        foreach (($row["iris"]??[]) as $row2) {
634
                                        foreach (($row["iris"]??[]) as $row2) {
635
                                                $num_rows["iri"]++;
635
                                                $num_rows["iri"]++;
636
                                                OIDplus::db()->query("insert into ###iri (oid, name, longarc, well_known) values (?, ?, ?, ?)",
636
                                                OIDplus::db()->query("insert into ###iri (oid, name, longarc, well_known) values (?, ?, ?, ?)",
637
                                                        array($row["id"]??null, // sic: $row, not $row2
637
                                                        array($row["id"]??null, // sic: $row, not $row2
638
                                                                $row2["name"]??null,
638
                                                                $row2["name"]??null,
639
                                                                $row2["longarc"]??false,
639
                                                                (bool)($row2["longarc"]??false),
640
                                                                $row2["well_known"]??false)
640
                                                                (bool)($row2["well_known"]??false))
641
                                                );
641
                                                );
642
                                        }
642
                                        }
643
                                }
643
                                }
-
 
644
                                OIDplus::db()->query("update ###objects set created = null where created = '1900-01-01 00:00:00';");
-
 
645
                                OIDplus::db()->query("update ###objects set updated = null where updated = '1900-01-01 00:00:00';");
644
                        }
646
                        }
645
 
647
 
646
                        // Restore RAs (Table ra)
648
                        // Restore RAs (Table ra)
647
                        if ($import_ra) {
649
                        if ($import_ra) {
648
                                if (!BACKUP_RECOVERY_SPECIAL_TEST) {
650
                                if (!BACKUP_RECOVERY_SPECIAL_TEST) {
Line 664... Line 666...
664
                                                        $row["zip_town"]??null,
666
                                                        $row["zip_town"]??null,
665
                                                        $row["country"]??null,
667
                                                        $row["country"]??null,
666
                                                        $row["phone"]??null,
668
                                                        $row["phone"]??null,
667
                                                        $row["mobile"]??null,
669
                                                        $row["mobile"]??null,
668
                                                        $row["fax"]??null,
670
                                                        $row["fax"]??null,
669
                                                        $row["privacy"]??false,
671
                                                        (bool)($row["privacy"]??false),
670
                                                        $row["authkey"]??null,
672
                                                        $row["authkey"]??null,
671
                                                        $row["registered"]??null,
673
                                                        $row["registered"]??'1900-01-01 00:00:00',
672
                                                        $row["updated"]??null,
674
                                                        $row["updated"]??'1900-01-01 00:00:00',
673
                                                        $row["last_login"]??null)
675
                                                        $row["last_login"]??'1900-01-01 00:00:00')
674
                                        );
676
                                        );
675
                                }
677
                                }
-
 
678
                                OIDplus::db()->query("update ###ra set registered = null where registered = '1900-01-01 00:00:00';");
-
 
679
                                OIDplus::db()->query("update ###ra set updated = null where updated = '1900-01-01 00:00:00';");
-
 
680
                                OIDplus::db()->query("update ###ra set last_login = null where last_login = '1900-01-01 00:00:00';");
676
                        }
681
                        }
677
 
682
 
678
                        // Restore configuration (Table config)
683
                        // Restore configuration (Table config)
679
                        if ($import_config) {
684
                        if ($import_config) {
680
                                if (!BACKUP_RECOVERY_SPECIAL_TEST) {
685
                                if (!BACKUP_RECOVERY_SPECIAL_TEST) {
Line 689... Line 694...
689
                                        $num_rows["config"]++;
694
                                        $num_rows["config"]++;
690
                                        OIDplus::db()->query("insert into ###config (name, value, description, protected, visible) values (?, ?, ?, ?, ?)",
695
                                        OIDplus::db()->query("insert into ###config (name, value, description, protected, visible) values (?, ?, ?, ?, ?)",
691
                                                array($row["name"]??null,
696
                                                array($row["name"]??null,
692
                                                        $row["value"]??null,
697
                                                        $row["value"]??null,
693
                                                        $row["description"]??null,
698
                                                        $row["description"]??null,
694
                                                        $row["protected"]??false,
699
                                                        (bool)($row["protected"]??false),
695
                                                        $row["visible"]??false)
700
                                                        (bool)($row["visible"]??false))
696
                                        );
701
                                        );
697
                                }
702
                                }
698
 
703
 
699
                        }
704
                        }
700
 
705