aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Channel.php3
-rw-r--r--Zotlabs/Module/Chat.php13
-rw-r--r--Zotlabs/Module/Display.php1
-rw-r--r--Zotlabs/Module/Editwebpage.php1
-rw-r--r--Zotlabs/Module/Events.php12
-rw-r--r--Zotlabs/Module/Filestorage.php8
-rw-r--r--Zotlabs/Module/Mitem.php10
-rw-r--r--Zotlabs/Module/Network.php1
-rw-r--r--Zotlabs/Module/Photos.php10
-rw-r--r--Zotlabs/Module/Rpost.php1
-rw-r--r--Zotlabs/Module/Settings.php6
-rw-r--r--Zotlabs/Module/Thing.php8
-rw-r--r--Zotlabs/Module/Webpages.php1
-rw-r--r--Zotlabs/Module/Wiki.php17
14 files changed, 76 insertions, 16 deletions
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php
index c74802ec5..59cb9f06c 100644
--- a/Zotlabs/Module/Channel.php
+++ b/Zotlabs/Module/Channel.php
@@ -133,6 +133,7 @@ class Channel extends \Zotlabs\Web\Controller {
'nickname' => \App::$profile['channel_address'],
'lockstate' => (((strlen(\App::$profile['channel_allow_cid'])) || (strlen(\App::$profile['channel_allow_gid'])) || (strlen(\App::$profile['channel_deny_cid'])) || (strlen(\App::$profile['channel_deny_gid']))) ? 'lock' : 'unlock'),
'acl' => (($is_owner) ? populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post') : ''),
+ 'permissions' => (($is_owner) ? $channel_acl : ''),
'showacl' => (($is_owner) ? 'yes' : ''),
'bang' => '',
'visitor' => (($is_owner || $observer) ? true : false),
@@ -363,4 +364,4 @@ class Channel extends \Zotlabs\Web\Controller {
return $o;
}
-} \ No newline at end of file
+}
diff --git a/Zotlabs/Module/Chat.php b/Zotlabs/Module/Chat.php
index ff55a9319..2c0e7a155 100644
--- a/Zotlabs/Module/Chat.php
+++ b/Zotlabs/Module/Chat.php
@@ -218,14 +218,13 @@ class Chat extends \Zotlabs\Web\Controller {
notice( t('Feature disabled.') . EOL);
return $o;
}
-
-
+
$acl = new \Zotlabs\Access\AccessList($channel);
$channel_acl = $acl->get();
-
+
$lockstate = (($channel_acl['allow_cid'] || $channel_acl['allow_gid'] || $channel_acl['deny_cid'] || $channel_acl['deny_gid']) ? 'lock' : 'unlock');
require_once('include/acl_selectors.php');
-
+
$chatroom_new = '';
if(local_channel()) {
$chatroom_new = replace_macros(get_markup_template('chatroom_new.tpl'),array(
@@ -234,12 +233,16 @@ class Chat extends \Zotlabs\Web\Controller {
'$chat_expire' => array('chat_expire',t('Expiration of chats (minutes)'),120,''),
'$permissions' => t('Permissions'),
'$acl' => populate_acl($channel_acl,false),
+ '$allow_cid' => acl2json($channel_acl['allow_cid']),
+ '$allow_gid' => acl2json($channel_acl['allow_gid']),
+ '$deny_cid' => acl2json($channel_acl['deny_cid']),
+ '$deny_gid' => acl2json($channel_acl['deny_gid']),
'$lockstate' => $lockstate,
'$submit' => t('Submit')
));
}
-
+
$rooms = Zlib\Chatroom::roomlist(\App::$profile['profile_uid']);
$o .= replace_macros(get_markup_template('chatrooms.tpl'), array(
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index d1d4edc7d..35ed0c894 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -65,6 +65,7 @@ class Display extends \Zotlabs\Web\Controller {
'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => populate_acl($channel_acl),
+ 'permissions' => $channel_acl,
'bang' => '',
'visitor' => true,
'profile_uid' => local_channel(),
diff --git a/Zotlabs/Module/Editwebpage.php b/Zotlabs/Module/Editwebpage.php
index a55f81101..2da8871a2 100644
--- a/Zotlabs/Module/Editwebpage.php
+++ b/Zotlabs/Module/Editwebpage.php
@@ -151,6 +151,7 @@ class Editwebpage extends \Zotlabs\Web\Controller {
'post_id' => $post_id,
'visitor' => ($is_owner) ? true : false,
'acl' => populate_acl($itm[0],false,\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')),
+ 'permissions' => $itm[0],
'showacl' => ($is_owner) ? true : false,
'mimetype' => $mimetype,
'mimeselect' => true,
diff --git a/Zotlabs/Module/Events.php b/Zotlabs/Module/Events.php
index def5c437b..d27de9989 100644
--- a/Zotlabs/Module/Events.php
+++ b/Zotlabs/Module/Events.php
@@ -435,6 +435,10 @@ class Events extends \Zotlabs\Web\Controller {
$acl = new \Zotlabs\Access\AccessList($channel);
$perm_defaults = $acl->get();
+
+ $permissions = ((x($orig_event)) ? $orig_event : $perm_defaults);
+
+ //print_r(acl2json($permissions['allow_gid'])); killme();
$tpl = get_markup_template('event_form.tpl');
@@ -467,10 +471,16 @@ class Events extends \Zotlabs\Web\Controller {
'$sh_checked' => $sh_checked,
'$share' => array('share', t('Share this event'), $sh_checked, '', array(t('No'),t('Yes'))),
'$preview' => t('Preview'),
- '$permissions' => t('Permission settings'),
+ '$perms_label' => t('Permission settings'),
// populating the acl dialog was a permission description from view_stream because Cal.php, which
// displays events, says "since we don't currently have an event permission - use the stream permission"
'$acl' => (($orig_event['event_xchan']) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $perm_defaults), false, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'))),
+
+ '$allow_cid' => acl2json($permissions['allow_cid']),
+ '$allow_gid' => acl2json($permissions['allow_gid']),
+ '$deny_cid' => acl2json($permissions['deny_cid']),
+ '$deny_gid' => acl2json($permissions['deny_gid']),
+
'$submit' => t('Submit'),
'$advanced' => t('Advanced Options')
diff --git a/Zotlabs/Module/Filestorage.php b/Zotlabs/Module/Filestorage.php
index c3ef22e32..a401f4822 100644
--- a/Zotlabs/Module/Filestorage.php
+++ b/Zotlabs/Module/Filestorage.php
@@ -141,7 +141,7 @@ class Filestorage extends \Zotlabs\Web\Controller {
// Encode path that is used for link so it's a valid URL
// Keep slashes as slashes, otherwise mod_rewrite doesn't work correctly
$encoded_path = str_replace('%2F', '/', rawurlencode($cloudpath));
-
+
$o = replace_macros(get_markup_template('attach_edit.tpl'), array(
'$header' => t('Edit file permissions'),
'$file' => $f,
@@ -151,6 +151,10 @@ class Filestorage extends \Zotlabs\Web\Controller {
'$channelnick' => $channel['channel_address'],
'$permissions' => t('Permissions'),
'$aclselect' => $aclselect_e,
+ '$allow_cid' => acl2json($f['allow_cid']),
+ '$allow_gid' => acl2json($f['allow_gid']),
+ '$deny_cid' => acl2json($f['deny_cid']),
+ '$deny_gid' => acl2json($f['deny_gid']),
'$lockstate' => $lockstate,
'$permset' => t('Set/edit permissions'),
'$recurse' => array('recurse', t('Include all files and sub folders'), 0, '', array(t('No'), t('Yes'))),
@@ -161,7 +165,7 @@ class Filestorage extends \Zotlabs\Web\Controller {
'$submit' => t('Submit'),
'$attach_btn_title' => t('Share this file'),
'$link_btn_title' => t('Show URL to this file'),
- '$notify' => array('notify', t('Notify your contacts about this file'), 0, '', array(t('No'), t('Yes')))
+ '$notify' => array('notify', t('Notify your contacts about this file'), 0, '', array(t('No'), t('Yes'))),
));
echo $o;
diff --git a/Zotlabs/Module/Mitem.php b/Zotlabs/Module/Mitem.php
index b64b50c8e..28f51b81b 100644
--- a/Zotlabs/Module/Mitem.php
+++ b/Zotlabs/Module/Mitem.php
@@ -147,12 +147,16 @@ class Mitem extends \Zotlabs\Web\Controller {
else {
$display = (($r) ? 'none' : 'block');
}
-
+
$create = replace_macros(get_markup_template('mitemedit.tpl'), array(
'$menu_id' => \App::$data['menu']['menu_id'],
'$permissions' => t('Menu Item Permissions'),
'$permdesc' => t("\x28click to open/close\x29"),
'$aclselect' => populate_acl($acl->get(),false),
+ '$allow_cid' => acl2json($acl->get()['allow_cid']),
+ '$allow_gid' => acl2json($acl->get()['allow_gid']),
+ '$deny_cid' => acl2json($acl->get()['deny_cid']),
+ '$deny_gid' => acl2json($acl->get()['deny_gid']),
'$mitem_desc' => array('mitem_desc', t('Link Name'), '', 'Visible name of the link','*'),
'$mitem_link' => array('mitem_link', t('Link or Submenu Target'), '', t('Enter URL of the link or select a menu name to create a submenu'), '*', 'list="menu-names"'),
'$usezid' => array('usezid', t('Use magic-auth if available'), true, '', array(t('No'), t('Yes'))),
@@ -226,6 +230,10 @@ class Mitem extends \Zotlabs\Web\Controller {
'$permissions' => t('Menu Item Permissions'),
'$permdesc' => t("\x28click to open/close\x29"),
'$aclselect' => populate_acl($mitem,false),
+ '$allow_cid' => acl2json($mitem['allow_cid']),
+ '$allow_gid' => acl2json($mitem['allow_gid']),
+ '$deny_cid' => acl2json($mitem['deny_cid']),
+ '$deny_gid' => acl2json($mitem['deny_gid']),
'$mitem_id' => intval(argv(2)),
'$mitem_desc' => array('mitem_desc', t('Link text'), $mitem['mitem_desc'], '','*'),
'$mitem_link' => array('mitem_link', t('Link or Submenu Target'), $mitem['mitem_link'], 'Enter URL of the link or select a menu name to create a submenu', '*', 'list="menu-names"'),
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php
index 3b88cd8d6..0128adc2c 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -170,6 +170,7 @@ class Network extends \Zotlabs\Web\Controller {
'nickname' => $channel['channel_address'],
'lockstate' => (($private_editing || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => populate_acl((($private_editing) ? $def_acl : $channel_acl), true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'),
+ 'permissions' => (($private_editing) ? $def_acl : $channel_acl),
'bang' => (($private_editing) ? '!' : ''),
'visitor' => true,
'profile_uid' => local_channel(),
diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php
index 1eeab1461..6aeac7af7 100644
--- a/Zotlabs/Module/Photos.php
+++ b/Zotlabs/Module/Photos.php
@@ -668,6 +668,10 @@ class Photos extends \Zotlabs\Web\Controller {
'$selname' => $selname,
'$permissions' => t('Permissions'),
'$aclselect' => $aclselect,
+ '$allow_cid' => acl2json($channel_acl['allow_cid']),
+ '$allow_gid' => acl2json($channel_acl['allow_gid']),
+ '$deny_cid' => acl2json($channel_acl['deny_cid']),
+ '$deny_gid' => acl2json($channel_acl['deny_gid']),
'$lockstate' => $lockstate,
'$uploader' => $ret['addon_text'],
'$default' => (($ret['default_upload']) ? true : false),
@@ -1016,7 +1020,7 @@ class Photos extends \Zotlabs\Web\Controller {
// FIXME - remove this when we move to conversation module
$r = $r[0]['children'];
-
+
$edit = null;
if($can_post) {
$album_e = $ph[0]['album'];
@@ -1042,6 +1046,10 @@ class Photos extends \Zotlabs\Web\Controller {
'tag_label' => t('Add a Tag'),
'permissions' => t('Permissions'),
'aclselect' => $aclselect_e,
+ 'allow_cid' => acl2json($ph[0]['allow_cid']),
+ 'allow_gid' => acl2json($ph[0]['allow_gid']),
+ 'deny_cid' => acl2json($ph[0]['deny_cid']),
+ 'deny_gid' => acl2json($ph[0]['deny_gid']),
'lockstate' => $lockstate[0],
'help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com'),
'item_id' => ((count($linked_items)) ? $link_item['id'] : 0),
diff --git a/Zotlabs/Module/Rpost.php b/Zotlabs/Module/Rpost.php
index 9e3043d10..525f053de 100644
--- a/Zotlabs/Module/Rpost.php
+++ b/Zotlabs/Module/Rpost.php
@@ -116,6 +116,7 @@ class Rpost extends \Zotlabs\Web\Controller {
'nickname' => $channel['channel_address'],
'lockstate' => (($acl->is_private()) ? 'lock' : 'unlock'),
'acl' => populate_acl($channel_acl, true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'),
+ 'permissions' => $channel_acl,
'bang' => '',
'visitor' => true,
'profile_uid' => local_channel(),
diff --git a/Zotlabs/Module/Settings.php b/Zotlabs/Module/Settings.php
index 57a0aa535..12157944f 100644
--- a/Zotlabs/Module/Settings.php
+++ b/Zotlabs/Module/Settings.php
@@ -1220,6 +1220,10 @@ class Settings extends \Zotlabs\Web\Controller {
'$permissions' => t('Default Post and Publish Permissions'),
'$permdesc' => t("\x28click to open/close\x29"),
'$aclselect' => populate_acl($perm_defaults, false, \Zotlabs\Lib\PermissionDescription::fromDescription(t('Use my default audience setting for the type of object published'))),
+ '$allow_cid' => acl2json($perm_defaults['allow_cid']),
+ '$allow_gid' => acl2json($perm_defaults['allow_gid']),
+ '$deny_cid' => acl2json($perm_defaults['deny_cid']),
+ '$deny_gid' => acl2json($perm_defaults['deny_gid']),
'$suggestme' => $suggestme,
'$group_select' => $group_select,
'$role' => array('permissions_role' , t('Channel permissions category:'), $permissions_role, '', get_roles()),
@@ -1282,7 +1286,7 @@ class Settings extends \Zotlabs\Web\Controller {
call_hooks('settings_form',$o);
- $o .= '</form>' . "\r\n";
+ //$o .= '</form>' . "\r\n";
return $o;
}
diff --git a/Zotlabs/Module/Thing.php b/Zotlabs/Module/Thing.php
index 65fc0588e..a7ac63f73 100644
--- a/Zotlabs/Module/Thing.php
+++ b/Zotlabs/Module/Thing.php
@@ -312,6 +312,10 @@ class Thing extends \Zotlabs\Web\Controller {
'$imgurl' => $r[0]['obj_imgurl'],
'$permissions' => t('Permissions'),
'$aclselect' => populate_acl($channel_acl,false),
+ '$allow_cid' => acl2json($channel_acl['allow_cid']),
+ '$allow_gid' => acl2json($channel_acl['allow_gid']),
+ '$deny_cid' => acl2json($channel_acl['deny_cid']),
+ '$deny_gid' => acl2json($channel_acl['deny_gid']),
'$lockstate' => $lockstate,
'$submit' => t('Submit')
));
@@ -358,6 +362,10 @@ class Thing extends \Zotlabs\Web\Controller {
'$img_lbl' => t('URL for photo of thing (optional)'),
'$permissions' => t('Permissions'),
'$aclselect' => populate_acl($channel_acl,false),
+ '$allow_cid' => acl2json($channel_acl['allow_cid']),
+ '$allow_gid' => acl2json($channel_acl['allow_gid']),
+ '$deny_cid' => acl2json($channel_acl['deny_cid']),
+ '$deny_gid' => acl2json($channel_acl['deny_gid']),
'$lockstate' => $lockstate,
'$submit' => t('Submit')
));
diff --git a/Zotlabs/Module/Webpages.php b/Zotlabs/Module/Webpages.php
index d3199f223..0a48d43c6 100644
--- a/Zotlabs/Module/Webpages.php
+++ b/Zotlabs/Module/Webpages.php
@@ -127,6 +127,7 @@ class Webpages extends \Zotlabs\Web\Controller {
'nickname' => \App::$profile['channel_address'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => (($is_owner) ? populate_acl($channel_acl,false, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''),
+ 'permissions' => (($is_owner) ? $channel_acl : ''),
'showacl' => (($is_owner) ? true : false),
'visitor' => true,
'hide_location' => true,
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index 24a0b6e1c..bb4e9179c 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -74,11 +74,16 @@ class Wiki extends \Zotlabs\Web\Controller {
// Initialize the ACL to the channel default permissions
$x = array(
'lockstate' => (( $local_observer['channel_allow_cid'] ||
- $local_observer['channel_allow_gid'] ||
- $local_observer['channel_deny_cid'] ||
- $local_observer['channel_deny_gid'])
- ? 'lock' : 'unlock'),
+ $local_observer['channel_allow_gid'] ||
+ $local_observer['channel_deny_cid'] ||
+ $local_observer['channel_deny_gid'])
+ ? 'lock' : 'unlock'
+ ),
'acl' => populate_acl($channel_acl),
+ 'allow_cid' => acl2json($channel_acl['allow_cid']),
+ 'allow_gid' => acl2json($channel_acl['allow_gid']),
+ 'deny_cid' => acl2json($channel_acl['deny_cid']),
+ 'deny_gid' => acl2json($channel_acl['deny_gid']),
'bang' => ''
);
} else {
@@ -186,6 +191,10 @@ class Wiki extends \Zotlabs\Web\Controller {
'$page' => $pageUrlName,
'$lockstate' => $x['lockstate'],
'$acl' => $x['acl'],
+ '$allow_cid' => $x['allow_cid'],
+ '$allow_gid' => $x['allow_gid'],
+ '$deny_cid' => $x['deny_cid'],
+ '$deny_gid' => $x['deny_gid'],
'$bang' => $x['bang'],
'$content' => $content,
'$renderedContent' => $renderedContent,