diff options
author | zotlabs <mike@macgirvin.com> | 2018-01-12 01:26:01 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-01-12 01:26:01 -0800 |
commit | e8958b1fb85ebcc4c51632a2de746b9aec6f354e (patch) | |
tree | b4b74f9fe5f140bc53830a12691d831ffe6cfa3a /Zotlabs/Module/Owa.php | |
parent | f0798f78333ef52c0859a57c71fd7502923b4242 (diff) | |
parent | 07b67963f128157e85c891057da2c42c286166e7 (diff) | |
download | volse-hubzilla-e8958b1fb85ebcc4c51632a2de746b9aec6f354e.tar.gz volse-hubzilla-e8958b1fb85ebcc4c51632a2de746b9aec6f354e.tar.bz2 volse-hubzilla-e8958b1fb85ebcc4c51632a2de746b9aec6f354e.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'Zotlabs/Module/Owa.php')
-rw-r--r-- | Zotlabs/Module/Owa.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/Zotlabs/Module/Owa.php b/Zotlabs/Module/Owa.php index d58fd7a41..9a39fe4c0 100644 --- a/Zotlabs/Module/Owa.php +++ b/Zotlabs/Module/Owa.php @@ -31,19 +31,21 @@ class Owa extends \Zotlabs\Web\Controller { if($keyId) { $r = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash - where hubloc_addr = '%s' limit 1", + where hubloc_addr = '%s' ", dbesc(str_replace('acct:','',$keyId)) ); if($r) { - $hubloc = $r[0]; - $verified = \Zotlabs\Web\HTTPSig::verify('',$hubloc['xchan_pubkey']); - if($verified && $verified['header_signed'] && $verified['header_valid']) { - $ret['success'] = true; - $token = random_string(32); - \Zotlabs\Zot\Verify::create('owt',0,$token,$r[0]['hubloc_addr']); - $result = ''; - openssl_public_encrypt($token,$result,$hubloc['xchan_pubkey']); - $ret['encrypted_token'] = base64url_encode($result); + foreach($r as $hubloc) { + $verified = \Zotlabs\Web\HTTPSig::verify('',$hubloc['xchan_pubkey']); + if($verified && $verified['header_signed'] && $verified['header_valid']) { + $ret['success'] = true; + $token = random_string(32); + \Zotlabs\Zot\Verify::create('owt',0,$token,$r[0]['hubloc_addr']); + $result = ''; + openssl_public_encrypt($token,$result,$hubloc['xchan_pubkey']); + $ret['encrypted_token'] = base64url_encode($result); + break; + } } } } |