aboutsummaryrefslogtreecommitdiffstats
path: root/include/directory.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/directory.php')
-rw-r--r--include/directory.php26
1 files changed, 15 insertions, 11 deletions
diff --git a/include/directory.php b/include/directory.php
index b0b975358..c0a8928c0 100644
--- a/include/directory.php
+++ b/include/directory.php
@@ -1,4 +1,5 @@
-g<?php
+<?php /** @file */
+
require_once('boot.php');
require_once('include/zot.php');
require_once('include/cli_startup.php');
@@ -18,11 +19,6 @@ function directory_run($argv, $argc){
if($dirmode === false)
$dirmode = DIRECTORY_MODE_NORMAL;
- if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) {
- syncdirs($argv[1]);
- return;
- }
-
$x = q("select * from channel where channel_id = %d limit 1",
intval($argv[1])
);
@@ -31,26 +27,34 @@ function directory_run($argv, $argc){
$channel = $x[0];
- // is channel profile visible to the public?
- // FIXME - remove dir entry if permission is revoked
- if(! perm_is_allowed($channel['channel_id'],null,'view_profile'))
+ if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) {
+ syncdirs($argv[1]);
+
+ // Now update all the connections
+ proc_run('php','include/notifier.php','refresh_all',$channel['channel_id']);
return;
+ }
$directory = find_upstream_directory($dirmode);
if($directory) {
- $url = $directory['url'];
+ $url = $directory['url'] . '/post';
}
else {
$url = DIRECTORY_FALLBACK_MASTER . '/post';
}
+ // ensure the upstream directory is updated
+
$packet = zot_build_packet($channel,'refresh');
$z = zot_zot($url,$packet);
-
// re-queue if unsuccessful
+ // Now update all the connections
+
+ proc_run('php','include/notifier.php','refresh_all',$channel['channel_id']);
+
}
if (array_search(__file__,get_included_files())===0){