aboutsummaryrefslogtreecommitdiffstats
path: root/include/notifier.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-09-08 20:14:17 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-09-08 20:14:17 -0700
commitffb1997902facb36b78a7cfa522f41f2b3d71cda (patch)
treee9fe47acf26c5fd2c742677f2610b60d3008eb26 /include/notifier.php
parentb49858b038a0a05bbe7685929e88071d0e125538 (diff)
downloadvolse-hubzilla-ffb1997902facb36b78a7cfa522f41f2b3d71cda.tar.gz
volse-hubzilla-ffb1997902facb36b78a7cfa522f41f2b3d71cda.tar.bz2
volse-hubzilla-ffb1997902facb36b78a7cfa522f41f2b3d71cda.zip
mistpark 2.0 infrasturcture lands
Diffstat (limited to 'include/notifier.php')
-rw-r--r--include/notifier.php21
1 files changed, 7 insertions, 14 deletions
diff --git a/include/notifier.php b/include/notifier.php
index 40fdbcc5f..b94c21e71 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -1,6 +1,6 @@
<?php
- $debugging = false;
+ $debugging = true;
require_once("boot.php");
@@ -19,9 +19,6 @@
$a->set_baseurl(get_config('system','url'));
- $baseurl = $argv[1];
- $a->set_baseurl($argv[1]);
-
$cmd = $argv[1];
switch($cmd) {
@@ -266,10 +263,10 @@
if($rr['self'])
continue;
- if((! strlen($rr['dfrn-id'])) || ($rr['duplex'] && ! strlen($rr['issued-id'])))
+ if((! strlen($rr['dfrn-id'])) && (! $rr['duplex']))
continue;
- $idtosend = (($rr['duplex']) ? $rr['issued-id'] : $rr['dfrn-id']);
+ $idtosend = (($rr['dfrn-id']) ? $rr['dfrn-id'] : $rr['issued-id']);
$url = $rr['notify'] . '?dfrn_id=' . $idtosend;
@@ -291,7 +288,7 @@
$challenge = hex2bin($res->challenge);
$final_dfrn_id = '';
- if($rr['duplex']) {
+ if($rr['duplex'] && strlen($rr['prvkey'])) {
openssl_private_decrypt($sent_dfrn_id,$final_dfrn_id,$rr['prvkey']);
openssl_private_decrypt($challenge,$postvars['challenge'],$rr['prvkey']);
}
@@ -301,18 +298,14 @@
}
$final_dfrn_id = substr($final_dfrn_id, 0, strpos($final_dfrn_id, '.'));
- if(($final_dfrn_id != $rr['dfrn-id']) || (($rr['duplex']) && ($final_dfrn_id != $rr['issued-id']))) {
+ if($final_dfrn_id != $idtosend) {
// did not decode properly - cannot trust this site
continue;
}
- $postvars['dfrn_id'] = (($duplex) ? $rr['issued-id'] : $rr['dfrn-id']);
+ $postvars['dfrn_id'] = $idtosend;
- if($cmd == 'mail') {
- $postvars['data'] = $atom;
- }
- elseif(((strlen($rr['dfrn-id'])) || (($rr['duplex']) && (strlen($rr['issued-id']))))
- && (! ($rr['blocked']) || ($rr['readonly']))) {
+ if((($rr['rel'] == DIRECTION_OUT) || ($rr['rel'] == DIRECTION_BOTH)) && (! $rr['blocked']) && (! $rr['readonly'])) {
$postvars['data'] = $atom;
}
else {