aboutsummaryrefslogtreecommitdiffstats
path: root/include/security.php
diff options
context:
space:
mode:
authorzottel <github@zottel.net>2016-08-01 14:07:18 +0200
committerzottel <github@zottel.net>2016-08-01 14:07:18 +0200
commit55eda16b61041cf5d3aa941f3b2b4329246b1028 (patch)
tree175b6395415767523f1046ee42d654efaf1dac8a /include/security.php
parentb5ea20ac863ebdbc4cc0bad6b7ca9876df336e8f (diff)
parent3d0c90cbc5b756c6d54c4d41a136c0a38e67b013 (diff)
downloadvolse-hubzilla-55eda16b61041cf5d3aa941f3b2b4329246b1028.tar.gz
volse-hubzilla-55eda16b61041cf5d3aa941f3b2b4329246b1028.tar.bz2
volse-hubzilla-55eda16b61041cf5d3aa941f3b2b4329246b1028.zip
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'include/security.php')
-rw-r--r--include/security.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/security.php b/include/security.php
index c67a1b400..7d2a49bdf 100644
--- a/include/security.php
+++ b/include/security.php
@@ -119,6 +119,34 @@ function atoken_xchan($atoken) {
return null;
}
+function atoken_abook($uid,$xchan_hash) {
+
+ if(substr($xchan_hash,16,1) != '.')
+ return false;
+
+ $r = q("select channel_hash from channel where channel_id = %d limit 1",
+ intval($uid)
+ );
+
+ if(! $r)
+ return false;
+
+ $x = q("select * from atoken where atoken_uid = %d and atoken_name = '%s'",
+ intval($uid),
+ dbesc(substr($xchan_hash,17))
+ );
+
+ if($x) {
+ $xchan = atoken_xchan($x[0]);
+ $xchan['abook_blocked'] = 0;
+ $xchan['abook_ignored'] = 0;
+ $xchan['abook_pending'] = 0;
+ return $xchan;
+ }
+
+ return false;
+
+}
/**