From 83354b2b88218090988dd6e526b0a2505b57e0f1 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Thu, 6 Apr 2023 22:18:28 +0200 Subject: Updated 5 files and added 1110 files (automated) --- includes/refresh.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'includes/refresh.php') diff --git a/includes/refresh.php b/includes/refresh.php index 98bda15..8c50dfb 100644 --- a/includes/refresh.php +++ b/includes/refresh.php @@ -137,4 +137,19 @@ chdir("../.."); echo("Fetched school information\n"); +echo("Updating address book...\n"); + +$contacts = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/addressbook/contacts.json"), true); + +foreach ($contacts as $id => $_) { + $out = []; + exec("cd /_ch/includes/jobs && php UpdateContactMethods.php {\\\"contact\\\":\\\"$id\\\"}", $out); + + foreach ($out as $line) { + echo(" " . $line . "\n"); + } +} + +echo("Updated address book\n"); + echo("Completed.\n"); \ No newline at end of file -- cgit