Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
This commit is contained in:
commit
0e76cec28f
@ -53,29 +53,25 @@ class Deliver {
|
|||||||
remove_queue_item($r[0]['outq_hash']);
|
remove_queue_item($r[0]['outq_hash']);
|
||||||
|
|
||||||
if($dresult && is_array($dresult)) {
|
if($dresult && is_array($dresult)) {
|
||||||
if(array_key_exists('iv',$dresult)) {
|
|
||||||
$dresult = json_decode(crypto_unencapsulate($dresult,get_config('system','prvkey')),true);
|
// delivery reports for local deliveries do not require encryption
|
||||||
}
|
|
||||||
if(! $dresult) {
|
foreach($dresult as $xx) {
|
||||||
logger('dreport decryption failure');
|
if(is_array($xx) && array_key_exists('message_id',$xx)) {
|
||||||
}
|
if(delivery_report_is_storable($xx)) {
|
||||||
else {
|
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s','%s','%s','%s','%s' ) ",
|
||||||
foreach($dresult as $xx) {
|
dbesc($xx['message_id']),
|
||||||
if(is_array($xx) && array_key_exists('message_id',$xx)) {
|
dbesc($xx['location']),
|
||||||
if(delivery_report_is_storable($xx)) {
|
dbesc($xx['recipient']),
|
||||||
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s','%s','%s','%s','%s' ) ",
|
dbesc($xx['status']),
|
||||||
dbesc($xx['message_id']),
|
dbesc(datetime_convert($xx['date'])),
|
||||||
dbesc($xx['location']),
|
dbesc($xx['sender'])
|
||||||
dbesc($xx['recipient']),
|
);
|
||||||
dbesc($xx['status']),
|
|
||||||
dbesc(datetime_convert($xx['date'])),
|
|
||||||
dbesc($xx['sender'])
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
q("delete from dreport where dreport_queue = '%s'",
|
q("delete from dreport where dreport_queue = '%s'",
|
||||||
dbesc($argv[$x])
|
dbesc($argv[$x])
|
||||||
);
|
);
|
||||||
|
@ -206,7 +206,7 @@ class Site {
|
|||||||
// directory server should not be set or settable unless we are a directory client
|
// directory server should not be set or settable unless we are a directory client
|
||||||
|
|
||||||
if($dirmode == DIRECTORY_MODE_NORMAL) {
|
if($dirmode == DIRECTORY_MODE_NORMAL) {
|
||||||
$x = q("select site_url from site where site_flags in (%d,%d) and site_realm = '%s'",
|
$x = q("select site_url from site where site_flags in (%d,%d) and site_realm = '%s' and site_dead = 0",
|
||||||
intval(DIRECTORY_MODE_SECONDARY),
|
intval(DIRECTORY_MODE_SECONDARY),
|
||||||
intval(DIRECTORY_MODE_PRIMARY),
|
intval(DIRECTORY_MODE_PRIMARY),
|
||||||
dbesc($realm)
|
dbesc($realm)
|
||||||
|
@ -36,7 +36,8 @@ class Pubsites extends \Zotlabs\Web\Controller {
|
|||||||
$o .= '</tr>';
|
$o .= '</tr>';
|
||||||
if($j['sites']) {
|
if($j['sites']) {
|
||||||
foreach($j['sites'] as $jj) {
|
foreach($j['sites'] as $jj) {
|
||||||
if(! \Zotlabs\Lib\System::compatible_project($jj['project']))
|
$projectname = explode(' ',$jj['project']);
|
||||||
|
if(! \Zotlabs\Lib\System::compatible_project($projectname[0]))
|
||||||
continue;
|
continue;
|
||||||
if(strpos($jj['version'],' ')) {
|
if(strpos($jj['version'],' ')) {
|
||||||
$x = explode(' ', $jj['version']);
|
$x = explode(' ', $jj['version']);
|
||||||
|
@ -67,8 +67,10 @@ class HTTPSig {
|
|||||||
$sig_block = self::parse_sigheader($headers['authorization']);
|
$sig_block = self::parse_sigheader($headers['authorization']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! $sig_block)
|
if(! $sig_block) {
|
||||||
|
logger('no signature provided.');
|
||||||
return $result;
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
logger('sig_block: ' . print_r($sig_block,true), LOGGER_DATA);
|
logger('sig_block: ' . print_r($sig_block,true), LOGGER_DATA);
|
||||||
|
|
||||||
|
@ -977,6 +977,18 @@ function zot_process_response($hub, $arr, $outq) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(is_array($x) && array_key_exists('delivery_report',$x) && is_array($x['delivery_report'])) {
|
if(is_array($x) && array_key_exists('delivery_report',$x) && is_array($x['delivery_report'])) {
|
||||||
|
|
||||||
|
if(array_key_exists('iv',$x['delivery_report'])) {
|
||||||
|
$j = crypto_unencapsulate($x['delivery_report'],get_config('system','prvkey'));
|
||||||
|
if($j) {
|
||||||
|
$x['delivery_report'] = json_decode($j,true);
|
||||||
|
}
|
||||||
|
if(! (is_array($x['delivery_report']) && count($x['delivery_report']))) {
|
||||||
|
logger('encrypted delivery report could not be decrypted');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach($x['delivery_report'] as $xx) {
|
foreach($x['delivery_report'] as $xx) {
|
||||||
if(is_array($xx) && array_key_exists('message_id',$xx) && delivery_report_is_storable($xx)) {
|
if(is_array($xx) && array_key_exists('message_id',$xx) && delivery_report_is_storable($xx)) {
|
||||||
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s','%s','%s','%s','%s' ) ",
|
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s','%s','%s','%s','%s' ) ",
|
||||||
@ -1048,13 +1060,15 @@ function zot_fetch($arr) {
|
|||||||
|
|
||||||
foreach($ret_hubs as $ret_hub) {
|
foreach($ret_hubs as $ret_hub) {
|
||||||
|
|
||||||
|
$secret = substr(preg_replace('/[^0-9a-fA-F]/','',$arr['secret']),0,64);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'type' => 'pickup',
|
'type' => 'pickup',
|
||||||
'url' => z_root(),
|
'url' => z_root(),
|
||||||
'callback_sig' => base64url_encode(rsa_sign(z_root() . '/post', get_config('system','prvkey'))),
|
'callback_sig' => base64url_encode(rsa_sign(z_root() . '/post', get_config('system','prvkey'))),
|
||||||
'callback' => z_root() . '/post',
|
'callback' => z_root() . '/post',
|
||||||
'secret' => $arr['secret'],
|
'secret' => $secret,
|
||||||
'secret_sig' => base64url_encode(rsa_sign($arr['secret'], get_config('system','prvkey')))
|
'secret_sig' => base64url_encode(rsa_sign($secret, get_config('system','prvkey')))
|
||||||
];
|
];
|
||||||
|
|
||||||
$algorithm = zot_best_algorithm($ret_hub['site_crypto']);
|
$algorithm = zot_best_algorithm($ret_hub['site_crypto']);
|
||||||
@ -1064,8 +1078,11 @@ function zot_fetch($arr) {
|
|||||||
|
|
||||||
$result = zot_import($fetch, $arr['sender']['url']);
|
$result = zot_import($fetch, $arr['sender']['url']);
|
||||||
|
|
||||||
if($result)
|
if($result) {
|
||||||
|
$result = crypto_encapsulate(json_encode($result),$ret_hub['hubloc_sitekey'], $algorithm);
|
||||||
return $result;
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -9,5 +9,6 @@
|
|||||||
[/region]
|
[/region]
|
||||||
[region=content]
|
[region=content]
|
||||||
[widget=common_friends][/widget]
|
[widget=common_friends][/widget]
|
||||||
|
$content
|
||||||
[/region]
|
[/region]
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<div id="main-slider" class="slider" ><input id="main-range" type="text" name="cminmax" value="{{$val}}" /></div>
|
<div id="main-slider" class="slider" ><input id="main-range" type="text" name="cminmax" value="{{$val}}" /></div>
|
||||||
|
<div id="profile-jot-text-loading" style="display:none;"></div>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var old_cmin = 0;
|
var old_cmin = 0;
|
||||||
@ -19,6 +20,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
var slideTimer = null;
|
var slideTimer = null;
|
||||||
function networkRefresh() {
|
function networkRefresh() {
|
||||||
|
|
||||||
$("#profile-jot-text-loading").show();
|
$("#profile-jot-text-loading").show();
|
||||||
|
|
||||||
if((document.readyState !== "complete") || (slideTimer !== null))
|
if((document.readyState !== "complete") || (slideTimer !== null))
|
||||||
|
Reference in New Issue
Block a user