From 0c77a127f2e10bcea23e49d5eef61ce444046b31 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 15 Jul 2015 14:03:34 +0200 Subject: show inherited state in Connection Default Permissions --- mod/connedit.php | 9 +++++++-- view/tpl/abook_edit.tpl | 7 +++++-- view/tpl/field_acheckbox.tpl | 6 +++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/mod/connedit.php b/mod/connedit.php index f628fb9d3..129c07bd3 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -644,13 +644,17 @@ function connedit_content(&$a) { foreach($global_perms as $k => $v) { $thisperm = (($contact['abook_my_perms'] & $v[1]) ? "1" : ''); + $checkinherited = ((($channel[$v[0]]) && ($channel[$v[0]] != PERMS_SPECIFIC)) ? "1" : ''); + // For auto permissions (when $self is true) we don't want to look at existing // permissions because they are enabled for the channel owner if((! $self) && ($existing[$k])) $thisperm = "1"; - $perms[] = array('perms_' . $k, $v[3], (($contact['abook_their_perms'] & $v[1]) ? "1" : ""),$thisperm, $v[1], (($channel[$v[0]] == PERMS_SPECIFIC || $self) ? '' : '1'), $v[4]); + + + $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); } $o .= replace_macros($tpl,array( @@ -661,7 +665,7 @@ function connedit_content(&$a) { '$addr_text' => t('This connection\'s address is'), '$notself' => (($self) ? '' : '1'), '$self' => (($self) ? '1' : ''), - '$autolbl' => t('Apply the permissions indicated on this page to all new connections.'), + '$autolbl' => t('The permissions indicated on this page will be applied to all new connections.'), '$buttons' => (($self) ? '' : $buttons), '$lbl_slider' => t('Slide to adjust your degree of friendship'), '$lbl_rating' => t('Rating'), @@ -693,6 +697,7 @@ function connedit_content(&$a) { '$perms' => $perms, '$permlbl' => t('Individual Permissions'), '$permnote' => t('Some permissions may be inherited from your channel\'s privacy settings, which have higher priority than individual settings. You can not change those settings here.'), + '$permnote_self' => t('Some permissions may be inherited from your channel\'s privacy settings, which have higher priority than individual settings. You can change those settings here but they wont have any impact unless the inherited setting changes.'), '$lastupdtext' => t('Last update:'), '$last_update' => relative_date($contact['abook_connected']), '$profile_select' => contact_profile_assign($contact['abook_profile']), diff --git a/view/tpl/abook_edit.tpl b/view/tpl/abook_edit.tpl index 71693a553..93f52be8d 100755 --- a/view/tpl/abook_edit.tpl +++ b/view/tpl/abook_edit.tpl @@ -176,7 +176,8 @@
- {{$permnote}} + {{if $notself}}{{$permnote}}{{/if}} + {{if $self}}{{$permnote_self}}{{/if}}
@@ -194,7 +195,9 @@ {{if $self}}
-
{{$autolbl}}
+ {{include file="field_checkbox.tpl" field=$autoperms}}
{{/if}} diff --git a/view/tpl/field_acheckbox.tpl b/view/tpl/field_acheckbox.tpl index d2aad3875..f96fd5fd6 100755 --- a/view/tpl/field_acheckbox.tpl +++ b/view/tpl/field_acheckbox.tpl @@ -1,6 +1,6 @@ {{if $notself}} @@ -9,9 +9,9 @@ {{/if}} -- cgit v1.2.3 From 5fcf1256bd3d60e03dc9b39779bbad6051ce4682 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 15 Jul 2015 14:07:35 +0200 Subject: whitespace --- mod/connedit.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mod/connedit.php b/mod/connedit.php index 129c07bd3..8374954fb 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -643,17 +643,13 @@ function connedit_content(&$a) { foreach($global_perms as $k => $v) { $thisperm = (($contact['abook_my_perms'] & $v[1]) ? "1" : ''); - $checkinherited = ((($channel[$v[0]]) && ($channel[$v[0]] != PERMS_SPECIFIC)) ? "1" : ''); // For auto permissions (when $self is true) we don't want to look at existing // permissions because they are enabled for the channel owner - if((! $self) && ($existing[$k])) $thisperm = "1"; - - $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); } -- cgit v1.2.3 From ca1f6f8c5b9668a4bdb0bdb3b6bc32160bfd267e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 15 Jul 2015 14:14:10 +0200 Subject: provide info text for automatic permissions --- mod/connedit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/connedit.php b/mod/connedit.php index 8374954fb..d0cf71c73 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -656,7 +656,7 @@ function connedit_content(&$a) { $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), '', array(t('No'),('Yes'))), + '$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'), '$notself' => (($self) ? '' : '1'), -- cgit v1.2.3 From f4a1ca0692552f1b399c6f931f43b0a1ffef1f6a Mon Sep 17 00:00:00 2001 From: zottel Date: Wed, 15 Jul 2015 15:29:08 +0200 Subject: change sh to bash in shebang to make scripts work --- util/add_addon_repo | 2 +- util/add_theme_repo | 2 +- util/add_widget_repo | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/util/add_addon_repo b/util/add_addon_repo index 4979c06bc..decd9e091 100755 --- a/util/add_addon_repo +++ b/util/add_addon_repo @@ -1,4 +1,4 @@ -#!/bin/sh -f +#!/bin/bash -f if [ $# -ne 2 ]; then echo usage: $0 repo_url nickname diff --git a/util/add_theme_repo b/util/add_theme_repo index 70a8c6432..d41eba6d9 100755 --- a/util/add_theme_repo +++ b/util/add_theme_repo @@ -1,4 +1,4 @@ -#!/bin/sh -f +#!/bin/bash -f if [ $# -ne 2 ]; then diff --git a/util/add_widget_repo b/util/add_widget_repo index 449afe5db..347e8e4e1 100755 --- a/util/add_widget_repo +++ b/util/add_widget_repo @@ -1,4 +1,4 @@ -#!/bin/sh -f +#!/bin/bash -f if [ $# -ne 2 ]; then echo usage: $0 repo_url nickname -- cgit v1.2.3 From ba7acf88ad7f67977a9c039966c65d6e068a7f7d Mon Sep 17 00:00:00 2001 From: zottel Date: Wed, 15 Jul 2015 15:40:23 +0200 Subject: also change the update_ scripts --- util/update_addon_repo | 2 +- util/update_theme_repo | 2 +- util/update_widget_repo | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/util/update_addon_repo b/util/update_addon_repo index 42bd3a71f..5b531e6a5 100755 --- a/util/update_addon_repo +++ b/util/update_addon_repo @@ -1,4 +1,4 @@ -#!/bin/sh -f +#!/bin/bash -f if [ $# -ne 1 ]; then echo usage: $0 repository diff --git a/util/update_theme_repo b/util/update_theme_repo index 443b26591..cd71531d0 100755 --- a/util/update_theme_repo +++ b/util/update_theme_repo @@ -1,4 +1,4 @@ -#!/bin/sh -f +#!/bin/bash -f if [ $# -ne 1 ]; then diff --git a/util/update_widget_repo b/util/update_widget_repo index c00c85708..045122619 100755 --- a/util/update_widget_repo +++ b/util/update_widget_repo @@ -1,4 +1,4 @@ -#!/bin/sh -f +#!/bin/bash -f if [ $# -ne 1 ]; then echo usage: $0 repository -- cgit v1.2.3
-
+
{{$field.6}}
- + - {{if $field.5}}{{$inherited}}{{/if}} + {{if $field.5}}{{$inherited}}{{if $self}}{{if $field.7}} {{else}} {{/if}}{{/if}}{{/if}}