mirror of https://github.com/itflow-org/itflow
Merge pull request #597 from wrongecho/cron-readd-refresh
Re-add domain refreshing to cron
This commit is contained in:
commit
0bd170ba8f
31
cron.php
31
cron.php
|
|
@ -55,6 +55,27 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Cron', log_action = 'Started', log_description = 'Cron started for $company_name', company_id = $company_id");
|
||||
|
||||
|
||||
// REFRESH DOMAIN WHOIS DATA (1 a day)
|
||||
// Get the oldest updated domain (MariaDB shows NULLs first when ordering by default)
|
||||
$row = mysqli_fetch_array(mysqli_query($mysqli, "SELECT domain_id, domain_name FROM `domains` WHERE company_id = $company_id ORDER BY domain_updated_at LIMIT 1"));
|
||||
|
||||
if ($row) {
|
||||
$domain_id = $row['domain_id'];
|
||||
$domain_name = $row['domain_name'];
|
||||
|
||||
$expire = getDomainExpirationDate($domain_name);
|
||||
$records = getDomainRecords($domain_name);
|
||||
$a = mysqli_real_escape_string($mysqli, $records['a']);
|
||||
$ns = mysqli_real_escape_string($mysqli, $records['ns']);
|
||||
$mx = mysqli_real_escape_string($mysqli, $records['mx']);
|
||||
$txt = mysqli_real_escape_string($mysqli, $records['txt']);
|
||||
$whois = mysqli_real_escape_string($mysqli, $records['whois']);
|
||||
|
||||
// Update the domain
|
||||
mysqli_query($mysqli,"UPDATE domains SET domain_name = '$domain_name', domain_expire = '$expire', domain_ip = '$a', domain_name_servers = '$ns', domain_mail_servers = '$mx', domain_txt = '$txt', domain_raw_whois = '$whois' WHERE domain_id = $domain_id");
|
||||
}
|
||||
|
||||
// GET NOTIFICATIONS
|
||||
|
||||
// DOMAINS EXPIRING
|
||||
|
|
@ -412,7 +433,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
|
||||
} //End if Autosend is on
|
||||
} //End Recurring Invoices Loop
|
||||
|
||||
|
||||
if($config_telemetry == 1){
|
||||
|
||||
$current_version = exec("git rev-parse HEAD");
|
||||
|
|
@ -435,11 +456,11 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
|
||||
// Invoice Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('invoice_id') AS num FROM invoices"));
|
||||
$invoice_count = $row['num'];
|
||||
$invoice_count = $row['num'];
|
||||
|
||||
// Revenue Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('revenue_id') AS num FROM revenues"));
|
||||
$revenue_count = $row['num'];
|
||||
$revenue_count = $row['num'];
|
||||
|
||||
// Recurring Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('recurring_id') AS num FROM recurring"));
|
||||
|
|
@ -460,7 +481,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
// Payment Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('payment_id') AS num FROM payments WHERE payment_invoice_id > 0"));
|
||||
$payment_count = $row['num'];
|
||||
|
||||
|
||||
// Company Vendor Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('vendor_id') AS num FROM vendors WHERE vendor_template = 0 AND vendor_client_id = 0"));
|
||||
$company_vendor_count = $row['num'];
|
||||
|
|
@ -535,7 +556,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
|
||||
// Document Template Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('document_id') AS num FROM documents WHERE document_template = 1"));
|
||||
$document_template_count = $row['num'];
|
||||
$document_template_count = $row['num'];
|
||||
|
||||
// Shared Item Count
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('item_id') AS num FROM shared_items"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue