From 4fec7aa991e0afe63a47722a7186e6fd2058d20a Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 28 Oct 2015 20:11:58 -0700 Subject: add text hint how to set language in connection filter --- mod/connedit.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mod/connedit.php') diff --git a/mod/connedit.php b/mod/connedit.php index 65eba885a..fd3abdcf0 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -668,8 +668,8 @@ function connedit_content(&$a) { '$lbl_rating_txt' => t('Optionally explain your rating'), '$connfilter' => feature_enabled(local_channel(),'connfilter'), '$connfilter_label' => t('Custom Filter'), - '$incl' => array('abook_incl',t('Only import posts with this text'), $contact['abook_incl'],t('words one per line or #tags or /patterns/, leave blank to import all posts')), - '$excl' => array('abook_excl',t('Do not import posts with this text'), $contact['abook_excl'],t('words one per line or #tags or /patterns/, leave blank to import all posts')), + '$incl' => array('abook_incl',t('Only import posts with this text'), $contact['abook_incl'],t('words one per line or #tags or /patterns/ or lang=xx, leave blank to import all posts')), + '$excl' => array('abook_excl',t('Do not import posts with this text'), $contact['abook_excl'],t('words one per line or #tags or /patterns/ or lang=xx, leave blank to import all posts')), '$rating_text' => array('rating_text', t('Optionally explain your rating'),$rating_text,''), '$rating_info' => t('This information is public!'), '$rating' => $rating, -- cgit v1.2.3 From 96402a235482af73c9c958ad9b1cf629d0bfb8cb Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 29 Oct 2015 01:23:56 -0700 Subject: This may take a few iterations to discover the best way to present the information, but we need a way for members to know what alternate locations are available for a channel during times of server issues - and as recently discovered if there aren't any hublocs at all; without digging around the database and probing channels and other messy stuff. --- mod/connedit.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'mod/connedit.php') diff --git a/mod/connedit.php b/mod/connedit.php index fd3abdcf0..d2b86ff86 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -652,12 +652,28 @@ function connedit_content(&$a) { $perms[] = array('perms_' . $k, $v[3], (($contact['abook_their_perms'] & $v[1]) ? "1" : ""),$thisperm, $v[1], (($channel[$v[0]] == PERMS_SPECIFIC) ? '' : '1'), $v[4], $checkinherited); } + $locstr = ''; + + $locs = q("select hubloc_addr as location from hubloc where hubloc_hash = '%s'", + dbesc($contact['xchan_hash']) + ); + + if($locs) { + foreach($locs as $l) { + if(strlen($locstr)) + $locstr .= ', '; + $locstr .= $l['location']; + } + } + $o .= replace_macros($tpl,array( '$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connection: %s'),$contact['xchan_name'])), '$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), 'Connection requests will be approved without your interaction', array(t('No'),('Yes'))), '$addr' => $contact['xchan_addr'], - '$addr_text' => t('This connection\'s address is'), + '$addr_text' => t('This connection\'s primary address is'), + '$loc_text' => t('Available locations:'), + '$locstr' => $locstr, '$notself' => (($self) ? '' : '1'), '$self' => (($self) ? '1' : ''), '$autolbl' => t('The permissions indicated on this page will be applied to all new connections.'), -- cgit v1.2.3 From bb469deb850dacc16e26ceb65f2a215a72eb6caa Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 29 Oct 2015 01:35:49 -0700 Subject: add entry for 'none' --- mod/connedit.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'mod/connedit.php') diff --git a/mod/connedit.php b/mod/connedit.php index d2b86ff86..c3fcc6d54 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -652,19 +652,21 @@ function connedit_content(&$a) { $perms[] = array('perms_' . $k, $v[3], (($contact['abook_their_perms'] & $v[1]) ? "1" : ""),$thisperm, $v[1], (($channel[$v[0]] == PERMS_SPECIFIC) ? '' : '1'), $v[4], $checkinherited); } - $locstr = ''; + $locstr = ''; - $locs = q("select hubloc_addr as location from hubloc where hubloc_hash = '%s'", - dbesc($contact['xchan_hash']) - ); + $locs = q("select hubloc_addr as location from hubloc where hubloc_hash = '%s'", + dbesc($contact['xchan_hash']) + ); - if($locs) { - foreach($locs as $l) { - if(strlen($locstr)) - $locstr .= ', '; - $locstr .= $l['location']; - } + if($locs) { + foreach($locs as $l) { + if(strlen($locstr)) + $locstr .= ', '; + $locstr .= $l['location']; } + } + else + $locstr = t('none'); $o .= replace_macros($tpl,array( -- cgit v1.2.3 From 5acfef8edb0b8f0b9a600ad192d38eae5e1fa69b Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 1 Nov 2015 21:32:28 +0100 Subject: since other networks do not support cloning we only need hublocs for zot contacts - fix #111 --- mod/connedit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/connedit.php') diff --git a/mod/connedit.php b/mod/connedit.php index c3fcc6d54..c8f83b0e8 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -654,7 +654,7 @@ function connedit_content(&$a) { $locstr = ''; - $locs = q("select hubloc_addr as location from hubloc where hubloc_hash = '%s'", + $locs = q("select hubloc_addr as location from hubloc where hubloc_hash = '%s' and hubloc_network = 'zot'", dbesc($contact['xchan_hash']) ); -- cgit v1.2.3 From 14e92f53f16b0f98bb4574f98c54c68e08d528dc Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 1 Nov 2015 16:19:28 -0800 Subject: hubloc filtering to eliminate dead and deleted entries --- mod/connedit.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mod/connedit.php') diff --git a/mod/connedit.php b/mod/connedit.php index c8f83b0e8..87ca55703 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -654,7 +654,8 @@ function connedit_content(&$a) { $locstr = ''; - $locs = q("select hubloc_addr as location from hubloc where hubloc_hash = '%s' and hubloc_network = 'zot'", + $locs = q("select hubloc_addr as location from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s' + and hubloc_network = 'zot' and hubloc_deleted = 0 and site_dead = 0", dbesc($contact['xchan_hash']) ); -- cgit v1.2.3 From 6ec021aafabb2d01d1965ab763aad5435251958a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 2 Nov 2015 08:36:43 +0100 Subject: revert filtering by metwork --- mod/connedit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/connedit.php') diff --git a/mod/connedit.php b/mod/connedit.php index 87ca55703..877c12dc7 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -655,7 +655,7 @@ function connedit_content(&$a) { $locstr = ''; $locs = q("select hubloc_addr as location from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s' - and hubloc_network = 'zot' and hubloc_deleted = 0 and site_dead = 0", + and hubloc_deleted = 0 and site_dead = 0", dbesc($contact['xchan_hash']) ); -- cgit v1.2.3 From 5c2692a8ea6de0a5e0ccfa0a2b9508d2d62266c6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 8 Nov 2015 16:36:36 -0800 Subject: no comment permission bug, also implement delete() in RedDirectory per Waitman --- mod/connedit.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'mod/connedit.php') diff --git a/mod/connedit.php b/mod/connedit.php index 877c12dc7..ad311f9a4 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -177,16 +177,21 @@ function connedit_post(&$a) { if(($_REQUEST['pending']) && intval($orig_record[0]['abook_pending'])) { $new_friend = true; - if(! $abook_my_perms) { - $abook_my_perms = get_channel_default_perms(local_channel()); + // @fixme it won't be common, but when you accept a new connection request + // the permissions will now be that of your permissions role and ignore + // any you may have set manually on the form. We'll probably see a bug if somebody + // tries to set the permissions *and* approve the connection in the same + // request. The workaround is to approve the connection, then go back and + // adjust permissions as desired. - $role = get_pconfig(local_channel(),'system','permissions_role'); - if($role) { - $x = get_role_perms($role); - if($x['perms_accept']) - $abook_my_perms = $x['perms_accept']; - } + $abook_my_perms = get_channel_default_perms(local_channel()); + + $role = get_pconfig(local_channel(),'system','permissions_role'); + if($role) { + $x = get_role_perms($role); + if($x['perms_accept']) + $abook_my_perms = $x['perms_accept']; } } -- cgit v1.2.3 From 11c8cabf28a23383979ceb33ec8264ae2b732f3e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 8 Nov 2015 20:41:11 -0800 Subject: suppress duplicate locations in connedit, issue #111 --- mod/connedit.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mod/connedit.php') diff --git a/mod/connedit.php b/mod/connedit.php index ad311f9a4..9c46fa999 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -666,6 +666,10 @@ function connedit_content(&$a) { if($locs) { foreach($locs as $l) { + if(!($l['location'])) + continue; + if(strpos($locstr,$l['location']) !== false) + continue; if(strlen($locstr)) $locstr .= ', '; $locstr .= $l['location']; -- cgit v1.2.3