summaryrefslogtreecommitdiff
path: root/includes/refresh.php
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-04-06 22:18:28 +0200
committerRaindropsSys <contact@minteck.org>2023-04-06 22:18:28 +0200
commit83354b2b88218090988dd6e526b0a2505b57e0f1 (patch)
treee3c73c38a122a78bb7e66fbb99056407edd9d4b9 /includes/refresh.php
parent47b8f2299a483024c4a6a8876af825a010954caa (diff)
downloadpluralconnect-83354b2b88218090988dd6e526b0a2505b57e0f1.tar.gz
pluralconnect-83354b2b88218090988dd6e526b0a2505b57e0f1.tar.bz2
pluralconnect-83354b2b88218090988dd6e526b0a2505b57e0f1.zip
Updated 5 files and added 1110 files (automated)
Diffstat (limited to 'includes/refresh.php')
-rw-r--r--includes/refresh.php15
1 files changed, 15 insertions, 0 deletions
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