Merge remote-tracking branch 'upstream/develop' into 1508-vier-popup-menu

Conflicts:
	mod/dfrn_notify.php
This commit is contained in:
Michael Vogel 2015-08-30 10:44:29 +02:00
commit cc3419f101
4 changed files with 8160 additions and 7991 deletions

View file

@ -1986,13 +1986,12 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) {
if($contact['duplex'] && $contact['issued-id']) if($contact['duplex'] && $contact['issued-id'])
$idtosend = '1:' . $orig_id; $idtosend = '1:' . $orig_id;
$rino = get_config('system','rino_encrypt'); $rino = get_config('system','rino_encrypt');
$rino = intval($rino); $rino = intval($rino);
logger("Local rino version: ". $rino, LOGGER_DEBUG);
$ssl_val = intval(get_config('system','ssl_policy')); $ssl_val = intval(get_config('system','ssl_policy'));
$ssl_policy = ''; $ssl_policy = '';
@ -2043,6 +2042,8 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) {
$rino_remote_version = intval($res->rino); $rino_remote_version = intval($res->rino);
$page = (($owner['page-flags'] == PAGE_COMMUNITY) ? 1 : 0); $page = (($owner['page-flags'] == PAGE_COMMUNITY) ? 1 : 0);
logger("Remote rino version: ".$rino_remote_version." for ".$contact["url"], LOGGER_DEBUG);
if($owner['page-flags'] == PAGE_PRVGROUP) if($owner['page-flags'] == PAGE_PRVGROUP)
$page = 2; $page = 2;
@ -2120,26 +2121,26 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) {
return -1; return -1;
} catch (CannotPerformOperation $ex) { } catch (CannotPerformOperation $ex) {
logger('Cannot safely create a key'); logger('Cannot safely create a key');
return -1; return -1;
} }
try { try {
$data = Crypto::encrypt($postvars['data'], $key); $data = Crypto::encrypt($postvars['data'], $key);
} catch (CryptoTestFailed $ex) { } catch (CryptoTestFailed $ex) {
logger('Cannot safely perform encryption'); logger('Cannot safely perform encryption');
return -1; return -1;
} catch (CannotPerformOperation $ex) { } catch (CannotPerformOperation $ex) {
logger('Cannot safely perform encryption'); logger('Cannot safely perform encryption');
return -1; return -1;
} }
break; break;
default: default:
logger("rino: invalid requested verision '$rino_remote_version'"); logger("rino: invalid requested verision '$rino_remote_version'");
return -1; return -1;
} }
$postvars['rino'] = $rino_remote_version; $postvars['rino'] = $rino_remote_version;
$postvars['data'] = bin2hex($data); $postvars['data'] = bin2hex($data);
#logger('rino: sent key = ' . $key, LOGGER_DEBUG); #logger('rino: sent key = ' . $key, LOGGER_DEBUG);
@ -2167,7 +2168,7 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) {
$postvars['key'] = bin2hex($postvars['key']); $postvars['key'] = bin2hex($postvars['key']);
} }
logger('dfrn_deliver: ' . "SENDING: " . print_r($postvars,true), LOGGER_DATA); logger('dfrn_deliver: ' . "SENDING: " . print_r($postvars,true), LOGGER_DATA);

View file

@ -93,6 +93,8 @@ function dfrn_notify_post(&$a) {
$importer = $r[0]; $importer = $r[0];
logger("Remote rino version: ".$rino_remote." for ".$importer["url"], LOGGER_DEBUG);
if((($writable != (-1)) && ($writable != $importer['writable'])) || ($importer['forum'] != $forum) || ($importer['prv'] != $prv)) { if((($writable != (-1)) && ($writable != $importer['writable'])) || ($importer['forum'] != $forum) || ($importer['prv'] != $prv)) {
q("UPDATE `contact` SET `writable` = %d, forum = %d, prv = %d WHERE `id` = %d", q("UPDATE `contact` SET `writable` = %d, forum = %d, prv = %d WHERE `id` = %d",
intval(($writable == (-1)) ? $importer['writable'] : $writable), intval(($writable == (-1)) ? $importer['writable'] : $writable),
@ -132,6 +134,10 @@ function dfrn_notify_post(&$a) {
if($importer['page-flags'] == PAGE_SOAPBOX) if($importer['page-flags'] == PAGE_SOAPBOX)
xml_status(0); xml_status(0);
$rino = get_config('system','rino_encrypt');
$rino = intval($rino);
logger("Local rino version: ". $rino, LOGGER_DEBUG);
if(strlen($key)) { if(strlen($key)) {
@ -273,6 +279,8 @@ function dfrn_notify_content(&$a) {
if(! count($r)) if(! count($r))
$status = 1; $status = 1;
logger("Remote rino version: ".$rino_remote." for ".$r[0]["url"], LOGGER_DEBUG);
$challenge = ''; $challenge = '';
$encrypted_id = ''; $encrypted_id = '';
$id_str = $my_id . '.' . mt_rand(1000,9999); $id_str = $my_id . '.' . mt_rand(1000,9999);
@ -299,6 +307,8 @@ function dfrn_notify_content(&$a) {
$rino = get_config('system','rino_encrypt'); $rino = get_config('system','rino_encrypt');
$rino = intval($rino); $rino = intval($rino);
logger("Local rino version: ". $rino, LOGGER_DEBUG);
// if requested rino is lower than enabled local rino, lower local rino version // if requested rino is lower than enabled local rino, lower local rino version
// if requested rino is higher than enabled local rino, reply with local rino // if requested rino is higher than enabled local rino, reply with local rino
if ($rino_remote < $rino) $rino = $rino_remote; if ($rino_remote < $rino) $rino = $rino_remote;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff