Files
itflow/admin/database_updates/2.8.3.php
johnnyq 75df17698b Domains makeover: rebuilt domains list with expiry pills (red expired, amber close, blue close but auto-renewing), registrar and hosts shown once per vendor with their roles, SPF/DMARC/DKIM email pills, filters for Starred, Expiring in 45 days, Expired, No auto-renew and Email gaps with counts, registrar-or-host and tag filters, search across notes, hosts and tag names, safe column sorting, open straight to a domain with ?open=ID; new domain quick look with expiry, auto-renew, registration date and status, who registers it and hosts DNS, website and email, A/NS/MX records to copy, plain-language email checks (SPF strictness and duplicates, DMARC policy, DKIM at common selectors), certificates, services, the registrar and host logins, notes, TXT records, raw WHOIS and history; tabbed add/edit form that tidies pasted addresses to the domain, checks the name as it is typed (saved as, subdomain, already on the client), auto-renew switch, star, tags, client and our own vendors as registrar and hosts, Registrar does it all; add several domains at once from a pasted list; bulk look up now, set registrar or host, tags, star and unstar; domain tags (tag type 7) with a starter pack; refresher looks up a batch of up to 50 a run, never-checked, stale and soon-to-expire first; expiry alerts skip archived domains and clients, mention auto-renew and open the domain; vendor Domains tab opens the quick look and adds a domain with that vendor as registrar, our vendors get a Client domains tab; service quick look, overview renewals and search open the domain; client portal shows days to expiry and auto-renew; more export columns and filters; demo data with auto-renew, varied DMARC and DKIM, WHOIS lines and campaign domains near expiry. Fixes lookups, edits, the refresher and API updates wiping expiry dates and records when a lookup came back empty, edits logged without a client and dropping a past expiry date, every edit running slow lookups, expiry alerts for archived domains, deleted domains left on services and certificates, bulk archive needing delete rights and list actions limited to admins, registrar and host pickers accepting another client's vendors and dropping our own on save, services linking other clients' domains, a new client's website domain not added when its expiry could not be found, the WHOIS summary cut at 254 characters, and API names, vendors and duplicates not checked. Adds functions/domain.php helpers, domain quick look and shared form, domain_check lookup; removes domain_model.php. DB 2.8.3
2026-10-15 00:09:09 -04:00

33 lines
1.9 KiB
PHP

<?php
/*
* ITFlow - Database update to version 2.8.3 (from 2.8.2)
* Included by admin/database_updates.php - do not access directly
*/
defined('FROM_DB_UPDATER') || die("Direct file access is not allowed");
// Domain tags (tag type 7) - Primary, Parked, Client-owned, Managed DNS and so on
mysqli_query($mysqli, "CREATE TABLE IF NOT EXISTS `domain_tags` (
`domain_id` int(11) NOT NULL,
`tag_id` int(11) NOT NULL,
PRIMARY KEY (`domain_id`, `tag_id`),
KEY `tag_id` (`tag_id`),
CONSTRAINT `domain_tags_ibfk_1` FOREIGN KEY (`domain_id`) REFERENCES `domains` (`domain_id`) ON DELETE CASCADE,
CONSTRAINT `domain_tags_ibfk_2` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`tag_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci");
// Whether it renews by itself at the registrar, its DMARC record and the
// DKIM selectors found, and when the lookups last came back with something
mysqli_query($mysqli, "ALTER TABLE `domains`
ADD COLUMN `domain_auto_renew` tinyint(1) NOT NULL DEFAULT 0 AFTER `domain_expire`,
ADD COLUMN `domain_dmarc` text DEFAULT NULL AFTER `domain_txt`,
ADD COLUMN `domain_dkim` varchar(255) DEFAULT NULL AFTER `domain_dmarc`,
ADD COLUMN `domain_refreshed_at` datetime DEFAULT NULL AFTER `domain_accessed_at`
");
// Domains deleted before deletes cleared their references left services and
// certificates pointing at an id that no longer exists
mysqli_query($mysqli, "DELETE `service_domains` FROM `service_domains` LEFT JOIN `domains` ON `domains`.`domain_id` = `service_domains`.`domain_id` WHERE `domains`.`domain_id` IS NULL");
mysqli_query($mysqli, "UPDATE `certificates` LEFT JOIN `domains` ON `domain_id` = `certificate_domain_id` SET `certificate_domain_id` = 0 WHERE `certificate_domain_id` > 0 AND `domain_id` IS NULL");