aboutsummaryrefslogtreecommitdiffstats
path: root/mod/zfinger.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-12-26 16:43:13 -0800
committerfriendica <info@friendica.com>2012-12-26 16:43:13 -0800
commit84fefcd469db5a2f542884cce413b8147cb6cfc7 (patch)
treeb4e28ef5dd0ec42e12924cc88d373fbb64a3037f /mod/zfinger.php
parentc8292b3cddf0a29236cb981111beb4587d7be411 (diff)
downloadvolse-hubzilla-84fefcd469db5a2f542884cce413b8147cb6cfc7.tar.gz
volse-hubzilla-84fefcd469db5a2f542884cce413b8147cb6cfc7.tar.bz2
volse-hubzilla-84fefcd469db5a2f542884cce413b8147cb6cfc7.zip
add important profile fields to zot-info if permitted - for directory
Diffstat (limited to 'mod/zfinger.php')
-rw-r--r--mod/zfinger.php34
1 files changed, 22 insertions, 12 deletions
diff --git a/mod/zfinger.php b/mod/zfinger.php
index 6dcadb384..1c51cdee9 100644
--- a/mod/zfinger.php
+++ b/mod/zfinger.php
@@ -70,18 +70,27 @@ function zfinger_init(&$a) {
$id = $e['channel_id'];
$searchable = (($e['channel_pageflags'] & PAGE_HIDDEN) ? false : true);
-
-
-// This is for birthdays and keywords, but must check access permissions
-// $r = q("select contact.*, profile.*
-// from contact left join profile on contact.uid = profile.uid
-// where contact.uid = %d && contact.self = 1 and profile.is_default = 1 limit 1",
-// intval($id)
-// );
-// if($r && count($r)) {
-// $profile = $r[0];
-// }
+
+
+ // This is for birthdays and keywords, but must check access permissions
+ $p = q("select * from profile where uid = %d and is_default = 1",
+ intval($e['channel_id'])
+ );
+
+ $profile = array();
+
+ if($p) {
+ $profile['description'] = $p[0]['pdesc'];
+ $profile['birthday'] = $p[0]['dob'];
+ $profile['gender'] = $p[0]['gender'];
+ $profile['marital'] = $p[0]['marital'];
+ $profile['sexual'] = $p[0]['sexual'];
+ $profile['locale'] = $p[0]['locality'];
+ $profile['region'] = $p[0]['region'];
+ $profile['postcode'] = $p[0]['postal_code'];
+ $profile['country'] = $p[0]['country_name'];
+ }
$ret['success'] = true;
@@ -112,7 +121,8 @@ function zfinger_init(&$a) {
$ret['permissions'] = (($ztarget) ? aes_encapsulate(json_encode($permissions),$zkey) : $permissions);
-// $ret['profile'] = $profile;
+ if($permissions['view_profile'])
+ $ret['profile'] = $profile;
// array of (verified) hubs this channel uses