require access token to view, query, or join directories in private realms, if the realm is so configured.

This commit is contained in:
friendica
2015-02-24 16:36:27 -08:00
parent 11df605c2e
commit 08f054130f
8 changed files with 68 additions and 14 deletions

View File

@@ -92,6 +92,9 @@ function directory_content(&$a) {
$url = $directory['url'] . '/dirsearch';
}
$token = get_config('system','realm_token');
logger('mod_directory: URL = ' . $url, LOGGER_DEBUG);
$contacts = array();
@@ -106,8 +109,6 @@ function directory_content(&$a) {
}
}
if($url) {
// We might want to make the tagadelic count (&kw=) configurable or turn it off completely.
@@ -116,6 +117,9 @@ function directory_content(&$a) {
$kw = ((intval($numtags)) ? $numtags : 24);
$query = $url . '?f=&kw=' . $kw . (($safe_mode != 1) ? '&safe=' . $safe_mode : '');
if($token)
$query .= '&t=' . $token;
if($search)
$query .= '&name=' . urlencode($search) . '&keywords=' . urlencode($search);
if(strpos($search,'@'))