aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-02 02:04:07 -0700
committerfriendica <info@friendica.com>2012-11-02 02:04:07 -0700
commitaf9890cd3e6721c46c65b4220ae292bbaea59143 (patch)
tree4d9da5c5d49a17caef414f301c0c8981149146f2
parent8ae77d2984771992fe34e76893ac933b1f433812 (diff)
downloadvolse-hubzilla-af9890cd3e6721c46c65b4220ae292bbaea59143.tar.gz
volse-hubzilla-af9890cd3e6721c46c65b4220ae292bbaea59143.tar.bz2
volse-hubzilla-af9890cd3e6721c46c65b4220ae292bbaea59143.zip
consolidate permission arrays
-rw-r--r--include/permissions.php47
-rw-r--r--mod/settings.php8
2 files changed, 15 insertions, 40 deletions
diff --git a/include/permissions.php b/include/permissions.php
index ef87a31a5..8611cb5f5 100644
--- a/include/permissions.php
+++ b/include/permissions.php
@@ -4,49 +4,24 @@
function get_perms() {
$global_perms = array(
// Read only permissions
- 'view_stream' => array('channel_r_stream', intval(PERMS_R_STREAM), true),
- 'view_profile' => array('channel_r_profile', intval(PERMS_R_PROFILE), true),
- 'view_photos' => array('channel_r_photos', intval(PERMS_R_PHOTOS), true),
- 'view_contacts' => array('channel_r_abook', intval(PERMS_R_ABOOK), true),
+ 'view_stream' => array('channel_r_stream', intval(PERMS_R_STREAM), true, t('Who can view your channel stream and posts')),
+ 'view_profile' => array('channel_r_profile', intval(PERMS_R_PROFILE), true, t('Who can view your channel profile')),
+ 'view_photos' => array('channel_r_photos', intval(PERMS_R_PHOTOS), true, t('Who can view your photo albums')),
+ 'view_contacts' => array('channel_r_abook', intval(PERMS_R_ABOOK), true, t('Who can view your address book')),
// Write permissions
- 'send_stream' => array('channel_w_stream', intval(PERMS_W_STREAM), false),
- 'post_wall' => array('channel_w_wall', intval(PERMS_W_WALL), false),
- 'tag_deliver' => array('channel_w_tagwall', intval(PERMS_W_TAGWALL), false),
- 'post_comments' => array('channel_w_comment', intval(PERMS_W_COMMENT), false),
- 'post_mail' => array('channel_w_mail', intval(PERMS_W_MAIL), false),
- 'post_photos' => array('channel_w_photos', intval(PERMS_W_PHOTOS), false),
- 'chat' => array('channel_w_chat', intval(PERMS_W_CHAT), false),
+ 'send_stream' => array('channel_w_stream', intval(PERMS_W_STREAM), false, t('Who can send you their channel stream and posts')),
+ 'post_wall' => array('channel_w_wall', intval(PERMS_W_WALL), false, t('Who can post on your channel page')),
+ 'post_comments' => array('channel_w_comment', intval(PERMS_W_COMMENT), false, t('Who can comment on your posts')),
+ 'post_mail' => array('channel_w_mail', intval(PERMS_W_MAIL), false, t('Who can send you private mail messages')),
+ 'post_photos' => array('channel_w_photos', intval(PERMS_W_PHOTOS), false, t('Who can post photos to your photo albums')),
+ 'tag_deliver' => array('channel_w_tagwall', intval(PERMS_W_TAGWALL), false, t('Who can forward to all your channel contacts via post tags')),
+ 'chat' => array('channel_w_chat', intval(PERMS_W_CHAT), false, t('Who can chat with you (when available)')),
);
return $global_perms;
}
-// Since these include the translation function - they couldn't be included
-// in $global_perms without causing an include dependency, so we provide a parallel
-// array which isn't global.
-
-function perms_text() {
- $perms_text = array(
- 'view_stream' => t('Who can view your channel stream and posts'),
- 'view_profile' => t('Who can view your channel profile'),
- 'view_photos' => t('Who can view your photo albums'),
- 'view_contacts' => t('Who can view your address book'),
-
- 'send_stream' => t('Who can send you their channel stream and posts'),
- 'post_wall' => t('Who can post on your channel page'),
- 'post_comments' => t('Who can comment on your posts'),
- 'post_mail' => t('Who can send you private mail messages'),
- 'post_photos' => t('Who can post photos to your photo albums'),
- 'tag_deliver' => t('Who can forward to all your channel contacts via post tags'),
- 'chat' => t('Who can chat with you (when available)')
- );
- return $perms_text;
-}
-
-
-
-
/**
* get_all_perms($uid,$observer)
*
diff --git a/mod/settings.php b/mod/settings.php
index 3e8134d5c..af0c9f291 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -733,16 +733,16 @@ function settings_content(&$a) {
);
- foreach($perms as $k => $perm) {
+ foreach($global_perms as $k => $perm) {
$permiss[$k] = array(
'key' => $k,
- 'label' => $perm,
+ 'label' => $perm[3],
'fields' => array()
);
- $column = $global_perms[$k][0];
+ $column = $perm[0];
foreach($perm_cats as $cat) {
- if((! $global_perms[$k][2]) && $cat[1] == PERMS_PUBLIC)
+ if((! $perm[2]) && $cat[1] == PERMS_PUBLIC)
continue;
$permiss[$k]['fields'][] = array( $column, $cat[0], $cat[1], '', (($channel[$column] == $cat[1]) ? '1' : ''));
}