aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-14 22:43:56 -0700
committerfriendica <info@friendica.com>2014-09-14 22:43:56 -0700
commitea8a01791e521a9ae4ea211e1b2e152b27a0486c (patch)
treeb39c7fef325da1299603c61777fa0d5233eb4975
parent0dc33900b6799681683fd02f597e95acbd58e960 (diff)
downloadvolse-hubzilla-ea8a01791e521a9ae4ea211e1b2e152b27a0486c.tar.gz
volse-hubzilla-ea8a01791e521a9ae4ea211e1b2e152b27a0486c.tar.bz2
volse-hubzilla-ea8a01791e521a9ae4ea211e1b2e152b27a0486c.zip
allow the site to designate an admin channel that's visible to the outside world (via siteinfo/json). Otherwise we'll use the default channel of any accounts that have the account admin role.
-rwxr-xr-xboot.php3
-rw-r--r--mod/siteinfo.php8
2 files changed, 9 insertions, 2 deletions
diff --git a/boot.php b/boot.php
index b8457467e..339a1f052 100755
--- a/boot.php
+++ b/boot.php
@@ -216,8 +216,9 @@ define ( 'PAGE_DIRECTORY_CHANNEL', 0x0008 ); // system channel used for director
define ( 'PAGE_PREMIUM', 0x0010 );
define ( 'PAGE_ADULT', 0x0020 );
define ( 'PAGE_CENSORED', 0x0040 ); // Site admin has blocked this channel from appearing in casual search results and site feeds
-
define ( 'PAGE_SYSTEM', 0x1000 );
+define ( 'PAGE_HUBADMIN', 0x2000 ); // set this to indicate a preferred admin channel rather than the
+ // default channel of any accounts with the admin role.
define ( 'PAGE_REMOVED', 0x8000 );
diff --git a/mod/siteinfo.php b/mod/siteinfo.php
index 061989413..01355a51d 100644
--- a/mod/siteinfo.php
+++ b/mod/siteinfo.php
@@ -13,7 +13,13 @@ function siteinfo_init(&$a) {
if($r) {
$admin = array();
foreach($r as $rr) {
- $admin[] = array( 'name' => $rr['channel_name'], 'address' => $rr['channel_address'] . '@' . get_app()->get_hostname(), 'channel' => z_root() . '/channel/' . $rr['channel_address']);
+ if($rr['channel_pageflags'] & PAGE_HUBADMIN)
+ $admin[] = array( 'name' => $rr['channel_name'], 'address' => $rr['channel_address'] . '@' . get_app()->get_hostname(), 'channel' => z_root() . '/channel/' . $rr['channel_address']);
+ }
+ if(! $admin) {
+ foreach($r as $rr) {
+ $admin[] = array( 'name' => $rr['channel_name'], 'address' => $rr['channel_address'] . '@' . get_app()->get_hostname(), 'channel' => z_root() . '/channel/' . $rr['channel_address']);
+ }
}
}
else {