aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dirsearch.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-02-24 16:36:27 -0800
committerfriendica <info@friendica.com>2015-02-24 16:36:27 -0800
commit08f054130f5a57e2928e129131e7609271ec7f40 (patch)
treee4eb2166044c05f750c78fc30742835ae5294f44 /mod/dirsearch.php
parent11df605c2e065e123e58bd73525e7ca2113f40b8 (diff)
downloadvolse-hubzilla-08f054130f5a57e2928e129131e7609271ec7f40.tar.gz
volse-hubzilla-08f054130f5a57e2928e129131e7609271ec7f40.tar.bz2
volse-hubzilla-08f054130f5a57e2928e129131e7609271ec7f40.zip
require access token to view, query, or join directories in private realms, if the realm is so configured.
Diffstat (limited to 'mod/dirsearch.php')
-rw-r--r--mod/dirsearch.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 5a0a7cee8..12abfafb8 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -13,7 +13,6 @@ function dirsearch_content(&$a) {
$ret = array('success' => false);
-
$dirmode = intval(get_config('system','directory_mode'));
if($dirmode == DIRECTORY_MODE_NORMAL) {
@@ -21,6 +20,15 @@ function dirsearch_content(&$a) {
json_return_and_die($ret);
}
+ $access_token = $_REQUEST['t'];
+
+ $token = get_config('system','realm_token');
+ if($token && $access_token != $token) {
+ $result['message'] = t('This directory server requires an access token');
+ return;
+ }
+
+
if(argc() > 1 && argv(1) === 'sites') {
$ret = list_public_sites();
json_return_and_die($ret);