From 0b1cd826b05b6ec9637e373735967a2555eeb1d4 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 29 Sep 2015 11:48:41 +0200 Subject: do not store a recalled mail if we can not find the original mid --- include/items.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/items.php b/include/items.php index 7793d1fb2..ccc327409 100755 --- a/include/items.php +++ b/include/items.php @@ -3522,11 +3522,17 @@ function mail_store($arr) { dbesc($arr['mid']), intval($arr['channel_id']) ); + if($r) { logger('mail_store: duplicate item ignored. ' . print_r($arr,true)); return 0; } + if(! $r && $arr['mail_recalled'] = 1) { + logger('mail_store: recalled item not found. ' . print_r($arr,true)); + return 0; + } + call_hooks('post_mail',$arr); if(x($arr,'cancel')) { -- cgit v1.2.3 From 2a2da48d1871f408232a8397632f06528c8b43ae Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 29 Sep 2015 11:56:43 +0200 Subject: fix typo in 0b1cd826b05b6ec9637e373735967a2555eeb1d4 --- include/items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index ccc327409..e7cc02579 100755 --- a/include/items.php +++ b/include/items.php @@ -3528,7 +3528,7 @@ function mail_store($arr) { return 0; } - if(! $r && $arr['mail_recalled'] = 1) { + if(! $r && $arr['mail_recalled'] == 1) { logger('mail_store: recalled item not found. ' . print_r($arr,true)); return 0; } -- cgit v1.2.3 From c5294f994e5a0f52588eb03186e78ede75cb4b42 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 29 Sep 2015 16:55:51 -0700 Subject: check and repair sys channel locations (hublocs) in zot-finger if they are messed up --- include/zot.php | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index ef9f325d0..8e053ed6f 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2392,6 +2392,9 @@ function sync_locations($sender, $arr, $absolute = false) { } } } + else { + logger('No locations to sync!'); + } $ret['change_message'] = $what; $ret['changed'] = $changed; @@ -3783,7 +3786,65 @@ function zotinfo($arr) { $ret['site']['realm'] = get_directory_realm(); } + + check_zotinfo($e,$x,$ret); + + call_hooks('zot_finger',$ret); return($ret); } + + +function check_zotinfo($channel,$locations,&$ret) { + + // This function will likely expand as we find more things to detect and fix. + // 1. Because magic-auth is reliant on it, ensure that the system channel has a valid hubloc + // Force this to be the case if anything is found to be wrong with it. + + // @FIXME ensure that the system channel exists in the first place and has an xchan + + if($channel['channel_system']) { + // the sys channel must have a location (hubloc) + $valid_location = false; + if((count($locations) === 1) && ($locations[0]['primary']) && (! $locations[0]['deleted'])) { + $valid_location = true; + } + + if((! $locations) || (! $valid_locations)) { + + logger('System channel locations are not valid. Attempting repair.'); + + // Don't trust any existing records. Just get rid of them, but only do this + // for the sys channel as normal channels will be trickier. + + q("delete from hubloc where hubloc_hash = '%s'", + dbesc($channel['channel_hash']) + ); + $r = q("insert into hubloc ( hubloc_guid, hubloc_guid_sig, hubloc_hash, hubloc_addr, hubloc_primary, + hubloc_url, hubloc_url_sig, hubloc_host, hubloc_callback, hubloc_sitekey, hubloc_network ) + values ( '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s' )", + dbesc($channel['channel_guid']), + dbesc($channel['channel_guid_sig']), + dbesc($channel['channel_hash']), + dbesc($channel['channel_address'] . '@' . get_app()->get_hostname()), + intval(1), + dbesc(z_root()), + dbesc(base64url_encode(rsa_sign(z_root(),$channel['channel_prvkey']))), + dbesc(get_app()->get_hostname()), + dbesc(z_root() . '/post'), + dbesc(get_config('system','pubkey')), + dbesc('zot') + ); + if($r) { + $x = zot_encode_locations($channel); + if($x) { + $ret['locations'] = $x; + } + } + else { + logger('Unable to store sys hub location'); + } + } + } +} \ No newline at end of file -- cgit v1.2.3 From a795f03c486c0d6c32badc9850870f95d8d09059 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 29 Sep 2015 17:21:14 -0700 Subject: improve the sys channel location repair to check key issues and re-installs and/or site moves --- include/zot.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 8e053ed6f..ed0e84775 100644 --- a/include/zot.php +++ b/include/zot.php @@ -3798,6 +3798,9 @@ function zotinfo($arr) { function check_zotinfo($channel,$locations,&$ret) { + +// logger('locations: ' . print_r($locations,true),LOGGER_DATA); + // This function will likely expand as we find more things to detect and fix. // 1. Because magic-auth is reliant on it, ensure that the system channel has a valid hubloc // Force this to be the case if anything is found to be wrong with it. @@ -3808,10 +3811,15 @@ function check_zotinfo($channel,$locations,&$ret) { // the sys channel must have a location (hubloc) $valid_location = false; if((count($locations) === 1) && ($locations[0]['primary']) && (! $locations[0]['deleted'])) { - $valid_location = true; + if((rsa_verify($locations[0]['url'],base64url_decode($locations[0]['url_sig']),$channel['channel_pubkey'])) + && ($locations[0]['sitekey'] === get_config('system','pubkey')) + && ($locations[0]['url'] === z_root())) + $valid_location = true; + else + logger('sys channel: invalid url signature'); } - if((! $locations) || (! $valid_locations)) { + if((! $locations) || (! $valid_location)) { logger('System channel locations are not valid. Attempting repair.'); -- cgit v1.2.3 From 928fa44154e2d4ecbb2f08d30f428682b8d55e34 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 29 Sep 2015 21:08:12 -0700 Subject: more work on the notifier --- include/notifier.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/notifier.php b/include/notifier.php index 3b29229cf..db1aa9690 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -605,11 +605,16 @@ function notifier_run($argv, $argc){ 'request' => $request, 'normal_mode' => $normal_mode, 'packet_type' => $packet_type, - 'walltowall' => $walltowall + 'walltowall' => $walltowall, + 'queued' => array() ); call_hooks('notifier_hub',$narr); + if($narr['queued']) { + foreach($narr['queued'] as $pq) + $deliveries[] = $pq; + } continue; } -- cgit v1.2.3 From cca9f2392e2fe44476ea7373ef11533da9205a23 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 29 Sep 2015 22:11:10 -0700 Subject: queue cleanup, and report issues --- include/deliver.php | 12 ++++++++---- include/queue.php | 25 ++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/deliver.php b/include/deliver.php index 86fc90b3f..518f1bc44 100644 --- a/include/deliver.php +++ b/include/deliver.php @@ -29,6 +29,8 @@ function deliver_run($argv, $argc) { * If not, reduce the outq_priority. */ + $base = ''; + $h = parse_url($r[0]['outq_posturl']); if($h) { $base = $h['scheme'] . '://' . $h['host'] . (($h['port']) ? ':' . $h['port'] : ''); @@ -76,10 +78,12 @@ function deliver_run($argv, $argc) { $result = z_post_url($r[0]['outq_posturl'],$r[0]['outq_msg']); if($result['success'] && $result['return_code'] < 300) { logger('deliver: queue post success to ' . $r[0]['outq_posturl'], LOGGER_DEBUG); - q("update site set site_update = '%s', site_dead = 0 where site_url = '%s' ", - dbesc(datetime_convert()), - dbesc($site_url) - ); + if($base) { + q("update site set site_update = '%s', site_dead = 0 where site_url = '%s' ", + dbesc(datetime_convert()), + dbesc($base) + ); + } q("update dreport set status = '%s', dreport_time = '%s' where dreport_queue = '%s' limit 1", dbesc('accepted for delivery'), dbesc(datetime_convert()), diff --git a/include/queue.php b/include/queue.php index 18c8c5fa2..061f1507d 100644 --- a/include/queue.php +++ b/include/queue.php @@ -23,6 +23,9 @@ function queue_run($argv, $argc){ logger('queue: start'); + // delete all queue items more than 3 days old + // but first mark these sites dead if we haven't heard from them in a month + $r = q("select outq_posturl from outq where outq_created < %s - INTERVAL %s", db_utcnow(), db_quoteinterval('3 DAY') ); @@ -85,15 +88,34 @@ function queue_run($argv, $argc){ return; foreach($r as $rr) { + + $dresult = null; + if(in_array($rr['outq_posturl'],$deadguys)) continue; + $base = ''; + $h = parse_url($rr['outq_posturl']); + if($h) + $base = $h['scheme'] . '://' . $h['host'] . (($h['port']) ? ':' . $h['port'] : ''); + if($rr['outq_driver'] === 'post') { $result = z_post_url($rr['outq_posturl'],$rr['outq_msg']); if($result['success'] && $result['return_code'] < 300) { logger('queue: queue post success to ' . $rr['outq_posturl'], LOGGER_DEBUG); + if($base) { + q("update site set site_update = '%s', site_dead = 0 where site_url = '%s' ", + dbesc(datetime_convert()), + dbesc($base) + ); + } + q("update dreport set status = '%s', dreport_time = '%s' where dreport_queue = '%s' limit 1", + dbesc('accepted for delivery'), + dbesc(datetime_convert()), + dbesc($rr['outq_hash']) + ); $y = q("delete from outq where outq_hash = '%s'", - dbesc($rr['ouq_hash']) + dbesc($rr['outq_hash']) ); } else { @@ -102,6 +124,7 @@ function queue_run($argv, $argc){ dbesc(datetime_convert()), dbesc($rr['outq_hash']) ); + $deadguys[] = $rr['outq_posturl']; } continue; } -- cgit v1.2.3 From 5721f9f3a906afac989b88a6c5ed16ce3674c063 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 29 Sep 2015 22:51:06 -0700 Subject: wrong table column names --- include/deliver.php | 2 +- include/queue.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/deliver.php b/include/deliver.php index 518f1bc44..a338d1a89 100644 --- a/include/deliver.php +++ b/include/deliver.php @@ -84,7 +84,7 @@ function deliver_run($argv, $argc) { dbesc($base) ); } - q("update dreport set status = '%s', dreport_time = '%s' where dreport_queue = '%s' limit 1", + q("update dreport set dreport_result = '%s', dreport_time = '%s' where dreport_queue = '%s' limit 1", dbesc('accepted for delivery'), dbesc(datetime_convert()), dbesc($argv[$x]) diff --git a/include/queue.php b/include/queue.php index 061f1507d..71ac50c83 100644 --- a/include/queue.php +++ b/include/queue.php @@ -109,7 +109,7 @@ function queue_run($argv, $argc){ dbesc($base) ); } - q("update dreport set status = '%s', dreport_time = '%s' where dreport_queue = '%s' limit 1", + q("update dreport set dreport_result = '%s', dreport_time = '%s' where dreport_queue = '%s' limit 1", dbesc('accepted for delivery'), dbesc(datetime_convert()), dbesc($rr['outq_hash']) -- cgit v1.2.3 From e769fbaffb09aa673d7475c598e7df7e7978d210 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 29 Sep 2015 22:56:29 -0700 Subject: another error from the db logs --- include/zot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index ed0e84775..7707f34fc 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2771,7 +2771,7 @@ function import_site($arr, $pubkey) { else { $update = true; $r = q("insert into site ( site_location, site_url, site_access, site_flags, site_update, site_directory, site_register, site_sellpage, site_realm, site_type ) - values ( '%s', '%s', %d, %d, '%s', '%s', %d, '%s', '%s' )", + values ( '%s', '%s', %d, %d, '%s', '%s', %d, '%s', '%s', %d )", dbesc($site_location), dbesc($url), intval($access_policy), -- cgit v1.2.3 From fd290882fde0fe22471259771377ebabdb1b4492 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 30 Sep 2015 12:57:02 -0700 Subject: undo self-deliver check --- include/zot.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 635c36774..488c2772f 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1584,11 +1584,12 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ $channel = $r[0]; $DR->addto_recipient($channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>'); - if($d['hash'] === $sender['hash']) { - $DR->update('self delivery ignored'); - $result[] = $DR->get(); - continue; - } +// breaks comments? +// if($d['hash'] === $sender['hash']) { +// $DR->update('self delivery ignored'); +// $result[] = $DR->get(); +// continue; +// } // allow public postings to the sys channel regardless of permissions, but not -- cgit v1.2.3 From 4b7c052ed8fa3075ce4b5e9585574f2e712cb426 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 30 Sep 2015 12:59:13 -0700 Subject: undo self deliver check --- include/zot.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 7707f34fc..a6d7fce06 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1587,11 +1587,12 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ $channel = $r[0]; $DR->addto_recipient($channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>'); - if($d['hash'] === $sender['hash']) { - $DR->update('self delivery ignored'); - $result[] = $DR->get(); - continue; - } +// breaks comments? +// if($d['hash'] === $sender['hash']) { +// $DR->update('self delivery ignored'); +// $result[] = $DR->get(); +// continue; +// } // allow public postings to the sys channel regardless of permissions, but not // for comments travelling upstream. Wait and catch them on the way down. -- cgit v1.2.3 From 5265c190d4011a7362774f86ad82a05f4f87f2b8 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 30 Sep 2015 16:27:24 -0700 Subject: document the issue with cloned delivery to self vs normal delivery to self --- include/zot.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 488c2772f..fe51d1a7c 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1566,6 +1566,8 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ } } +logger('sender: ' . print_r($sender,true)); + foreach($deliveries as $d) { $local_public = $public; @@ -1584,8 +1586,17 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ $channel = $r[0]; $DR->addto_recipient($channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>'); -// breaks comments? -// if($d['hash'] === $sender['hash']) { + /** + * @FIXME: Somehow we need to block normal message delivery from our clones, as the delivered + * message doesn't have ACL information in it as the cloned copy does. That copy + * will normally arrive first via sync delivery, but this isn't guaranteed. + * There's a chance the current delivery could take place before the cloned copy arrives + * hence the item could have the wrong ACL and *could* be used in subsequent deliveries or + * access checks. So far all attempts at identifying this situation precisely + * have caused issues with delivery of relayed comments. + */ + +// if(($d['hash'] === $sender['hash']) && ($sender['url'] !== z_root()) && (! $relay)) { // $DR->update('self delivery ignored'); // $result[] = $DR->get(); // continue; -- cgit v1.2.3 From 9bdb7bef5dadb3cfb8e3ff661f68b5cc7a70c5cd Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 30 Sep 2015 19:27:53 -0700 Subject: add delivery reports to mail (not backported to redmatrix) --- include/zot.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index e9132b7a5..2f04cca1b 100644 --- a/include/zot.php +++ b/include/zot.php @@ -11,6 +11,7 @@ require_once('include/crypto.php'); require_once('include/items.php'); require_once('include/hubloc.php'); +require_once('include/DReport.php'); /** @@ -1556,7 +1557,6 @@ function allowed_public_recips($msg) { function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $request = false) { $result = array(); - require_once('include/DReport.php'); $result['site'] = z_root(); @@ -1569,7 +1569,6 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ } } -logger('sender: ' . print_r($sender,true)); foreach($deliveries as $d) { $local_public = $public; @@ -2043,20 +2042,26 @@ function process_mail_delivery($sender, $arr, $deliveries) { } foreach($deliveries as $d) { + + $DR = new DReport(z_root(),$sender['hash'],$d['hash'],$arr['mid']); + $r = q("select * from channel where channel_hash = '%s' limit 1", dbesc($d['hash']) ); if(! $r) { - $result[] = array($d['hash'],'not found'); + $DR->update('recipient not found'); + $result[] = $DR->get(); continue; } $channel = $r[0]; + $DR->addto_recipient($channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>'); if(! perm_is_allowed($channel['channel_id'],$sender['hash'],'post_mail')) { logger("permission denied for mail delivery {$channel['channel_id']}"); - $result[] = array($d['hash'],'permission denied',$channel['channel_name'],$arr['mid']); + $DR->update('permission denied'); + $result[] = $DR->get(); continue; } @@ -2070,11 +2075,13 @@ function process_mail_delivery($sender, $arr, $deliveries) { intval($r[0]['id']), intval($channel['channel_id']) ); - $result[] = array($d['hash'],'mail recalled',$channel['channel_name'],$arr['mid']); + $DR->update('mail recalled'); + $result[] = $DR->get(); logger('mail_recalled'); } else { - $result[] = array($d['hash'],'duplicate mail received',$channel['channel_name'],$arr['mid']); + $DR->update('duplicate mail received'); + $result[] = $DR->get(); logger('duplicate mail received'); } continue; @@ -2083,7 +2090,8 @@ function process_mail_delivery($sender, $arr, $deliveries) { $arr['account_id'] = $channel['channel_account_id']; $arr['channel_id'] = $channel['channel_id']; $item_id = mail_store($arr); - $result[] = array($d['hash'],'mail delivered',$channel['channel_name'],$arr['mid']); + $DR->update('mail delivered'); + $result[] = $DR->get(); } } -- cgit v1.2.3 From 986244eeeadd1ca18daf8f9337424bc5e7410389 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 30 Sep 2015 21:38:21 -0700 Subject: issue #63 - missing table fields in db query --- include/zot.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 2f04cca1b..942490551 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1960,8 +1960,7 @@ function delete_imported_item($sender, $item, $uid, $relay) { $item_found = false; $post_id = 0; - - $r = q("select id, item_deleted from item where ( author_xchan = '%s' or owner_xchan = '%s' or source_xchan = '%s' ) + $r = q("select id, author_xchan, owner_xchan, source_xchan, item_deleted from item where ( author_xchan = '%s' or owner_xchan = '%s' or source_xchan = '%s' ) and mid = '%s' and uid = %d limit 1", dbesc($sender['hash']), dbesc($sender['hash']), @@ -1969,6 +1968,7 @@ function delete_imported_item($sender, $item, $uid, $relay) { dbesc($item['mid']), intval($uid) ); + if ($r) { if ($r[0]['author_xchan'] === $sender['hash'] || $r[0]['owner_xchan'] === $sender['hash'] || $r[0]['source_xchan'] === $sender['hash']) $ownership_valid = true; -- cgit v1.2.3 From 63eb0e3a38c2e1d0548c1beb3260613f3e5503a6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 1 Oct 2015 17:28:03 -0700 Subject: allow additional uses for xtags --- include/taxonomy.php | 2 +- include/zot.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/taxonomy.php b/include/taxonomy.php index a5da190d4..36490291d 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -178,7 +178,7 @@ function dir_tagadelic($count = 0) { $count = intval($count); // Fetch tags - $r = q("select xtag_term, count(xtag_term) as total from xtag + $r = q("select xtag_term, count(xtag_term) as total from xtag where xtag_flags = 0 group by xtag_term order by total desc %s", ((intval($count)) ? "limit $count" : '') ); diff --git a/include/zot.php b/include/zot.php index fe51d1a7c..31fd4dbdd 100644 --- a/include/zot.php +++ b/include/zot.php @@ -918,7 +918,7 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED, $ud_arr = null) { $r = q("delete from xprof where xprof_hash = '%s'", dbesc($xchan_hash) ); - $r = q("delete from xtag where xtag_hash = '%s'", + $r = q("delete from xtag where xtag_hash = '%s' and xtag_flags = 0", dbesc($xchan_hash) ); } @@ -2585,7 +2585,7 @@ function import_directory_profile($hash, $profile, $addr, $ud_flags = UPDATE_FLA function import_directory_keywords($hash, $keywords) { $existing = array(); - $r = q("select * from xtag where xtag_hash = '%s'", + $r = q("select * from xtag where xtag_hash = '%s' and xtag_flags = 0", dbesc($hash) ); @@ -2603,14 +2603,14 @@ function import_directory_keywords($hash, $keywords) { foreach($existing as $x) { if(! in_array($x, $clean)) - $r = q("delete from xtag where xtag_hash = '%s' and xtag_term = '%s'", + $r = q("delete from xtag where xtag_hash = '%s' and xtag_term = '%s' and xtag_flags = 0", dbesc($hash), dbesc($x) ); } foreach($clean as $x) { if(! in_array($x, $existing)) { - $r = q("insert into xtag ( xtag_hash, xtag_term) values ( '%s' ,'%s' )", + $r = q("insert into xtag ( xtag_hash, xtag_term, xtag_flags) values ( '%s' ,'%s', 0 )", dbesc($hash), dbesc($x) ); -- cgit v1.2.3 From ebe374d572174e33dc3c4ea1e747efa88957f3be Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 1 Oct 2015 19:49:06 -0700 Subject: notification changes to support testdrive --- include/account.php | 2 ++ include/enotify.php | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/account.php b/include/account.php index 5926e05c1..b3a520fd4 100644 --- a/include/account.php +++ b/include/account.php @@ -217,6 +217,8 @@ function create_account($arr) { $result['email'] = $email; $result['password'] = $password; + call_hooks('register_account',$result); + return $result; } diff --git a/include/enotify.php b/include/enotify.php index d0228bf50..6f4083155 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -317,7 +317,9 @@ function notification($params) { 'sitelink' => $sitelink, 'tsitelink' => $tsitelink, 'hsitelink' => $hsitelink, - 'itemlink' => $itemlink + 'itemlink' => $itemlink, + 'sender' => $sender, + 'recipient' => $recip ); call_hooks('enotify', $h); -- cgit v1.2.3 From 982ff8733fc4c66833c94bb9d4c135f6fb3ed7fe Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 1 Oct 2015 19:54:28 -0700 Subject: one more change --- include/Contact.php | 2 ++ include/enotify.php | 1 + 2 files changed, 3 insertions(+) (limited to 'include') diff --git a/include/Contact.php b/include/Contact.php index 008574d8f..8e22c608e 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -319,6 +319,8 @@ function channel_remove($channel_id, $local = true, $unset_session=true) { q("DELETE FROM `pconfig` WHERE `uid` = %d", intval($channel_id)); q("DELETE FROM `spam` WHERE `uid` = %d", intval($channel_id)); + // @FIXME At this stage we need to remove the file resources located under /store/$nickname + q("delete from abook where abook_xchan = '%s' and abook_self = 1 ", dbesc($channel['channel_hash']) diff --git a/include/enotify.php b/include/enotify.php index 6f4083155..80afe8ed6 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -315,6 +315,7 @@ function notification($params) { 'epreamble' => $epreamble, 'body' => $body, 'sitelink' => $sitelink, + 'sitename' => $sitename, 'tsitelink' => $tsitelink, 'hsitelink' => $hsitelink, 'itemlink' => $itemlink, -- cgit v1.2.3