aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2020-12-18 09:02:13 +0000
committerMario <mario@mariovavti.com>2020-12-21 09:04:04 +0100
commit01e7e3c24a47fda2f7d2c12973a691d5d5a3572e (patch)
treeed60984d3177b7a75f6ef9675b6c6ed37857e0ea
parent8112dee91eeeb973217a40a0be918421e134de39 (diff)
downloadvolse-hubzilla-01e7e3c24a47fda2f7d2c12973a691d5d5a3572e.tar.gz
volse-hubzilla-01e7e3c24a47fda2f7d2c12973a691d5d5a3572e.tar.bz2
volse-hubzilla-01e7e3c24a47fda2f7d2c12973a691d5d5a3572e.zip
handle owa with hubloc_id_url only
(cherry picked from commit ed4bf1c13dd183647499ce4e18c869988f674368)
-rw-r--r--Zotlabs/Module/Owa.php12
-rw-r--r--include/zid.php8
2 files changed, 7 insertions, 13 deletions
diff --git a/Zotlabs/Module/Owa.php b/Zotlabs/Module/Owa.php
index a974f2c1a..28c70d168 100644
--- a/Zotlabs/Module/Owa.php
+++ b/Zotlabs/Module/Owa.php
@@ -32,16 +32,14 @@ class Owa extends Controller {
$keyId = $sigblock['keyId'];
if ($keyId) {
$r = q("SELECT * FROM hubloc LEFT JOIN xchan ON hubloc_hash = xchan_hash
- WHERE ( hubloc_addr = '%s' OR hubloc_id_url = '%s' ) AND hubloc_network IN ('zot6', 'zot')",
- dbesc(str_replace('acct:','',$keyId)),
+ WHERE hubloc_id_url = '%s'",
dbesc($keyId)
);
if (! $r) {
$found = discover_by_webbie(str_replace('acct:','',$keyId));
if ($found) {
$r = q("SELECT * FROM hubloc LEFT JOIN xchan ON hubloc_hash = xchan_hash
- WHERE ( hubloc_addr = '%s' OR hubloc_id_url = '%s' ) AND hubloc_network IN ('zot6', 'zot')",
- dbesc(str_replace('acct:','',$keyId)),
+ WHERE OR hubloc_id_url = '%s'",
dbesc($keyId)
);
}
@@ -51,16 +49,16 @@ class Owa extends Controller {
$verified = HTTPSig::verify(file_get_contents('php://input'));
if ($verified && $verified['header_signed'] && $verified['header_valid'] && ($verified['content_valid'] || (! $verified['content_signed']))) {
logger('OWA header: ' . print_r($verified,true),LOGGER_DATA);
- logger('OWA success: ' . $hubloc['hubloc_addr'],LOGGER_DATA);
+ logger('OWA success: ' . $hubloc['hubloc_id_url'],LOGGER_DATA);
$ret['success'] = true;
$token = random_string(32);
- Verify::create('owt',0,$token,$hubloc['hubloc_addr']);
+ Verify::create('owt',0,$token,$hubloc['hubloc_id_url']);
$result = '';
openssl_public_encrypt($token,$result,$hubloc['xchan_pubkey']);
$ret['encrypted_token'] = base64url_encode($result);
break;
} else {
- logger('OWA fail: ' . $hubloc['hubloc_id'] . ' ' . $hubloc['hubloc_addr']);
+ logger('OWA fail: ' . $hubloc['hubloc_id'] . ' ' . $hubloc['hubloc_id_url']);
}
}
}
diff --git a/include/zid.php b/include/zid.php
index 538adcc41..e24b0035d 100644
--- a/include/zid.php
+++ b/include/zid.php
@@ -286,9 +286,7 @@ function owt_init($token) {
}
$r = q("select * from hubloc left join xchan on xchan_hash = hubloc_hash
- where hubloc_addr = '%s' or hubloc_id_url = '%s' or hubloc_hash = '%s' order by hubloc_id desc",
- dbesc($ob_hash),
- dbesc($ob_hash),
+ where hubloc_id_url = '%s' order by hubloc_id desc",
dbesc($ob_hash)
);
@@ -297,9 +295,7 @@ function owt_init($token) {
$wf = discover_by_webbie($ob_hash);
if($wf) {
$r = q("select * from hubloc left join xchan on xchan_hash = hubloc_hash
- where hubloc_addr = '%s' or hubloc_id_url = '%s' or hubloc_hash = '%s' order by hubloc_id desc",
- dbesc($ob_hash),
- dbesc($ob_hash),
+ where hubloc_id_url = '%s' order by hubloc_id desc",
dbesc($ob_hash)
);
}