aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-02-02 17:32:54 -0800
committerfriendica <info@friendica.com>2015-02-02 17:32:54 -0800
commitfb6deb113b718e18bf1e5031ec868b53acf93c1e (patch)
treec14951765b5419a91b8f987f5c7e94a66819cf88
parent08689db4ffccc1a541f77cbf32ffbd11c1a4ac22 (diff)
downloadvolse-hubzilla-fb6deb113b718e18bf1e5031ec868b53acf93c1e.tar.gz
volse-hubzilla-fb6deb113b718e18bf1e5031ec868b53acf93c1e.tar.bz2
volse-hubzilla-fb6deb113b718e18bf1e5031ec868b53acf93c1e.zip
improved directory registration - honour standalones and do the right thing
-rwxr-xr-xboot.php7
-rw-r--r--mod/regdir.php11
2 files changed, 15 insertions, 3 deletions
diff --git a/boot.php b/boot.php
index 2f8d1c08f..74e77caa1 100755
--- a/boot.php
+++ b/boot.php
@@ -2200,6 +2200,13 @@ function get_directory_realm() {
* @return string
*/
function get_directory_primary() {
+
+ $dirmode = intval(get_config('system','directory_mode'));
+
+ if($dirmode == DIRECTORY_MODE_STANDALONE || $dirmode == DIRECTORY_MODE_PRIMARY) {
+ return z_root();
+ }
+
if($x = get_config('system', 'directory_primary'))
return $x;
diff --git a/mod/regdir.php b/mod/regdir.php
index c00187978..eecc99ca5 100644
--- a/mod/regdir.php
+++ b/mod/regdir.php
@@ -47,9 +47,14 @@ function regdir_init(&$a) {
json_return_and_die($result);
}
else {
- $r = q("select site_url from site where site_flags in ( 1, 2 ) and site_realm = '%s'",
- dbesc(get_directory_realm())
- );
+ if($dirmode == DIRECTORY_MODE_STANDALONE) {
+ $r = array(array('site_url' => z_root()));
+ }
+ else {
+ $r = q("select site_url from site where site_flags in ( 1, 2 ) and site_realm = '%s'",
+ dbesc(get_directory_realm())
+ );
+ }
if($r) {
$result['success'] = true;
$result['directories'] = array();