aboutsummaryrefslogtreecommitdiffstats
path: root/include/dir_fns.php
diff options
context:
space:
mode:
authormrjive <mrjive@mrjive.it>2015-11-11 16:51:48 +0100
committermrjive <mrjive@mrjive.it>2015-11-11 16:51:48 +0100
commit53a796afcc0cff6f9e3f51457df4506a43db1945 (patch)
treea2366c48e0dae047b052283cc44284224369c8cd /include/dir_fns.php
parenta4c3058f845a1c38d06b2201a10700c5f878366d (diff)
parentbc7c0ed844711e81c4bc642e3024849195a48421 (diff)
downloadvolse-hubzilla-53a796afcc0cff6f9e3f51457df4506a43db1945.tar.gz
volse-hubzilla-53a796afcc0cff6f9e3f51457df4506a43db1945.tar.bz2
volse-hubzilla-53a796afcc0cff6f9e3f51457df4506a43db1945.zip
Merge pull request #8 from redmatrix/master
get fresh code from HZ base
Diffstat (limited to 'include/dir_fns.php')
-rw-r--r--include/dir_fns.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php
index ecc5f6d96..398f43d00 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -15,6 +15,19 @@ function find_upstream_directory($dirmode) {
global $DIRECTORY_FALLBACK_SERVERS;
$preferred = get_config('system','directory_server');
+
+ // Thwart attempts to use a private directory
+
+ if(($preferred) && ($prefered != z_root())) {
+ $r = q("select * from site where site_url = '%s' limit 1",
+ dbesc($preferred)
+ );
+ if(($r) && ($r[0]['site_flags'] & DIRECTORY_MODE_STADALONE)) {
+ $preferred = '';
+ }
+ }
+
+
if (! $preferred) {
/*
@@ -190,8 +203,9 @@ function sync_directories($dirmode) {
intval($r[0]['site_valid'])
);
- $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and site_type = %d ",
- intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY),
+ $r = q("select * from site where site_flags in (%d, %d) and site_url != '%s' and site_type = %d ",
+ intval(DIRECTORY_MODE_PRIMARY),
+ intval(DIRECTORY_MODE_SECONDARY),
dbesc(z_root()),
intval(SITE_TYPE_ZOT)
);