aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-03-19 15:56:30 -0700
committerfriendica <info@friendica.com>2015-03-19 15:56:30 -0700
commitb1fd6c53a5f86fd752db9c5394cae8f67492f07e (patch)
tree552446b414bc8d5c21ce2518c5ebafd8f5813f03 /include/zot.php
parent24ebaaf0f70f3452c72c0ac4017bff1144728da8 (diff)
downloadvolse-hubzilla-b1fd6c53a5f86fd752db9c5394cae8f67492f07e.tar.gz
volse-hubzilla-b1fd6c53a5f86fd752db9c5394cae8f67492f07e.tar.bz2
volse-hubzilla-b1fd6c53a5f86fd752db9c5394cae8f67492f07e.zip
tweaks to directory registrations which don't seem to be happening, also downgrade any directory that claims to be a primary directory for RED_GLOBAL.
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/zot.php b/include/zot.php
index 5c12dc4ba..99a787cd9 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -2536,6 +2536,9 @@ function import_site($arr,$pubkey) {
if($arr['directory_mode'] == 'standalone')
$site_directory = DIRECTORY_MODE_STANDALONE;
+
+
+
$register_policy = 0;
if($arr['register_policy'] == 'closed')
$register_policy = REGISTER_CLOSED;
@@ -2573,6 +2576,17 @@ function import_site($arr,$pubkey) {
$site_location = htmlspecialchars($arr['location'],ENT_COMPAT,'UTF-8',false);
$site_realm = htmlspecialchars($arr['realm'],ENT_COMPAT,'UTF-8',false);
+ // You can have one and only one primary directory per realm.
+ // Downgrade any others claiming to be primary. As they have
+ // flubbed up this badly already, don't let them be directory servers at all.
+
+ if(($site_directory === DIRECTORY_MODE_PRIMARY)
+ && ($site_realm === get_directory_realm())
+ && ($arr['url'] != get_directory_primary())) {
+ $site_directory = DIRECTORY_MODE_NORMAL;
+ }
+
+
if($exists) {
if(($siterecord['site_flags'] != $site_directory)
|| ($siterecord['site_access'] != $access_policy)