improved directory registration - honour standalones and do the right thing
This commit is contained in:
parent
08689db4ff
commit
fb6deb113b
7
boot.php
7
boot.php
@ -2200,6 +2200,13 @@ function get_directory_realm() {
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function get_directory_primary() {
|
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'))
|
if($x = get_config('system', 'directory_primary'))
|
||||||
return $x;
|
return $x;
|
||||||
|
|
||||||
|
@ -46,10 +46,15 @@ function regdir_init(&$a) {
|
|||||||
|
|
||||||
json_return_and_die($result);
|
json_return_and_die($result);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if($dirmode == DIRECTORY_MODE_STANDALONE) {
|
||||||
|
$r = array(array('site_url' => z_root()));
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$r = q("select site_url from site where site_flags in ( 1, 2 ) and site_realm = '%s'",
|
$r = q("select site_url from site where site_flags in ( 1, 2 ) and site_realm = '%s'",
|
||||||
dbesc(get_directory_realm())
|
dbesc(get_directory_realm())
|
||||||
);
|
);
|
||||||
|
}
|
||||||
if($r) {
|
if($r) {
|
||||||
$result['success'] = true;
|
$result['success'] = true;
|
||||||
$result['directories'] = array();
|
$result['directories'] = array();
|
||||||
|
Reference in New Issue
Block a user