aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/System.php4
-rw-r--r--Zotlabs/Lib/ThreadItem.php3
-rw-r--r--Zotlabs/Module/Channel.php3
-rw-r--r--Zotlabs/Module/Chat.php13
-rw-r--r--Zotlabs/Module/Connedit.php30
-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/Rate.php2
-rw-r--r--Zotlabs/Module/Register.php11
-rw-r--r--Zotlabs/Module/Rpost.php1
-rw-r--r--Zotlabs/Module/Settings.php6
-rw-r--r--Zotlabs/Module/Setup.php24
-rw-r--r--Zotlabs/Module/Thing.php8
-rw-r--r--Zotlabs/Module/Webpages.php1
-rw-r--r--Zotlabs/Module/Wiki.php22
-rw-r--r--Zotlabs/Storage/Browser.php7
21 files changed, 128 insertions, 50 deletions
diff --git a/Zotlabs/Lib/System.php b/Zotlabs/Lib/System.php
index c52a90338..4479bf597 100644
--- a/Zotlabs/Lib/System.php
+++ b/Zotlabs/Lib/System.php
@@ -43,8 +43,8 @@ class System {
static public function get_server_role() {
- if(UNO)
- return 'basic';
+ if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['server_role'])
+ return \App::$config['system']['server_role'];
return 'pro';
}
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index 638afeb6b..eee3b2a4f 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -245,10 +245,11 @@ class ThreadItem {
);
}
+ $server_role = get_config('system','server_role');
$has_bookmarks = false;
if(is_array($item['term'])) {
foreach($item['term'] as $t) {
- if(!UNO && $t['ttype'] == TERM_BOOKMARK)
+ if(($server_role != 'basic') && ($t['ttype'] == TERM_BOOKMARK))
$has_bookmarks = true;
}
}
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/Connedit.php b/Zotlabs/Module/Connedit.php
index 93ee30999..8fa6f0e96 100644
--- a/Zotlabs/Module/Connedit.php
+++ b/Zotlabs/Module/Connedit.php
@@ -152,11 +152,16 @@ class Connedit extends \Zotlabs\Web\Controller {
$new_friend = false;
+ // only store a record and notify the directory if the rating changed
+
if(! $is_self) {
$signed = $orig_record[0]['abook_xchan'] . '.' . $rating . '.' . $rating_text;
-
$sig = base64url_encode(rsa_sign($signed,$channel['channel_prvkey']));
+
+ $rated = ((intval($rating) || strlen($rating_text)) ? true : false);
+
+ $record = 0;
$z = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 1 limit 1",
dbesc($channel['channel_hash']),
@@ -164,17 +169,20 @@ class Connedit extends \Zotlabs\Web\Controller {
);
if($z) {
- $record = $z[0]['xlink_id'];
- $w = q("update xlink set xlink_rating = '%d', xlink_rating_text = '%s', xlink_sig = '%s', xlink_updated = '%s'
- where xlink_id = %d",
- intval($rating),
- dbesc($rating_text),
- dbesc($sig),
- dbesc(datetime_convert()),
- intval($record)
- );
+ if(($z[0]['xlink_rating'] != $rating) || ($z[0]['xlink_rating_text'] != $rating_text)) {
+ $record = $z[0]['xlink_id'];
+ $w = q("update xlink set xlink_rating = '%d', xlink_rating_text = '%s', xlink_sig = '%s', xlink_updated = '%s'
+ where xlink_id = %d",
+ intval($rating),
+ dbesc($rating_text),
+ dbesc($sig),
+ dbesc(datetime_convert()),
+ intval($record)
+ );
+ }
}
- else {
+ elseif($rated) {
+ // only create a record if there's something to save
$w = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_sig, xlink_updated, xlink_static ) values ( '%s', '%s', %d, '%s', '%s', '%s', 1 ) ",
dbesc($channel['channel_hash']),
dbesc($orig_record[0]['abook_xchan']),
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/Rate.php b/Zotlabs/Module/Rate.php
index da23b840e..2f769b36b 100644
--- a/Zotlabs/Module/Rate.php
+++ b/Zotlabs/Module/Rate.php
@@ -43,7 +43,7 @@ class Rate extends \Zotlabs\Web\Controller {
}
- function post() {
+ function post() {
if(! local_channel())
return;
diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php
index 45123b88d..4cdd27001 100644
--- a/Zotlabs/Module/Register.php
+++ b/Zotlabs/Module/Register.php
@@ -151,7 +151,7 @@ class Register extends \Zotlabs\Web\Controller {
$new_channel = false;
$next_page = 'new_channel';
- if(get_config('system','auto_channel_create') || UNO) {
+ if(get_config('system','auto_channel_create') || get_config('system','server_role') == 'basic') {
$new_channel = auto_channel_create($result['account']['account_id']);
if($new_channel['success']) {
$channel_id = $new_channel['channel']['channel_id'];
@@ -234,9 +234,12 @@ class Register extends \Zotlabs\Web\Controller {
$privacy_role = ((x($_REQUEST,'permissions_role')) ? $_REQUEST['permissions_role'] : "");
$role = array('permissions_role' , t('Channel role and privacy'), ($privacy_role) ? $privacy_role : 'social', t('Select a channel role with your privacy requirements.') . ' <a href="help/roles" target="_blank">' . t('Read more about roles') . '</a>',get_roles());
$tos = array('tos', $label_tos, '', '', array(t('no'),t('yes')));
-
- $auto_create = ((UNO) || (get_config('system','auto_channel_create')) ? true : false);
- $default_role = ((UNO) ? 'social' : get_config('system','default_permissions_role'));
+
+ $server_role = get_config('system','server_role');
+
+
+ $auto_create = (($server_role == 'basic') || (get_config('system','auto_channel_create')) ? true : false);
+ $default_role = (($server_role == 'basic') ? 'social' : get_config('system','default_permissions_role'));
require_once('include/bbcode.php');
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/Setup.php b/Zotlabs/Module/Setup.php
index 802f0c216..4553b6866 100644
--- a/Zotlabs/Module/Setup.php
+++ b/Zotlabs/Module/Setup.php
@@ -101,7 +101,7 @@ class Setup extends \Zotlabs\Web\Controller {
$timezone = notags(trim($_POST['timezone']));
$adminmail = notags(trim($_POST['adminmail']));
$siteurl = notags(trim($_POST['siteurl']));
- $advanced = ((intval($_POST['advanced'])) ? 1 : 0);
+ $advanced = ((intval($_POST['advanced'])) ? 'pro' : 'basic');
if($siteurl != z_root()) {
$test = z_fetch_url($siteurl."/setup/testrewrite");
@@ -124,17 +124,17 @@ class Setup extends \Zotlabs\Web\Controller {
$tpl = get_intltext_template('htconfig.tpl');
$txt = replace_macros($tpl,array(
- '$dbhost' => $dbhost,
- '$dbport' => $dbport,
- '$dbuser' => $dbuser,
- '$dbpass' => $dbpass,
- '$dbdata' => $dbdata,
- '$dbtype' => $dbtype,
- '$uno' => 1 - $advanced,
- '$timezone' => $timezone,
- '$siteurl' => $siteurl,
- '$site_id' => random_string(),
- '$phpath' => $phpath,
+ '$dbhost' => $dbhost,
+ '$dbport' => $dbport,
+ '$dbuser' => $dbuser,
+ '$dbpass' => $dbpass,
+ '$dbdata' => $dbdata,
+ '$dbtype' => $dbtype,
+ '$server_role' => $advanced,
+ '$timezone' => $timezone,
+ '$siteurl' => $siteurl,
+ '$site_id' => random_string(),
+ '$phpath' => $phpath,
'$adminmail' => $adminmail
));
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 55a52ea6d..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 {
@@ -142,8 +147,8 @@ class Wiki extends \Zotlabs\Web\Controller {
}
$content = ($p['content'] !== '' ? htmlspecialchars_decode($p['content'],ENT_COMPAT) : '"# New page\n"');
// Render the Markdown-formatted page content in HTML
- require_once('library/markdown.php');
- $html = wiki_generate_toc(purify_html(Markdown(json_decode($content))));
+ require_once('library/markdown.php');
+ $html = wiki_generate_toc(purify_html(Markdown(wiki_bbcode(json_decode($content)))));
$renderedContent = wiki_convert_links($html,argv(0).'/'.argv(1).'/'.$wikiUrlName);
$hide_editor = false;
$showPageControls = $wiki_editor;
@@ -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,
@@ -221,6 +230,7 @@ class Wiki extends \Zotlabs\Web\Controller {
$content = $_POST['content'];
$resource_id = $_POST['resource_id'];
require_once('library/markdown.php');
+ $content = wiki_bbcode($content);
$html = wiki_generate_toc(purify_html(Markdown($content)));
$w = wiki_get_wiki($resource_id);
$wikiURL = argv(0).'/'.argv(1).'/'.$w['urlName'];
diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php
index 93c55bd4c..e72c4fb62 100644
--- a/Zotlabs/Storage/Browser.php
+++ b/Zotlabs/Storage/Browser.php
@@ -279,7 +279,7 @@ class Browser extends DAV\Browser\Plugin {
$aclselect = null;
$lockstate = '';
- if($this->auth-owner_id) {
+ if($this->auth->owner_id) {
$channel = channelx_by_n($this->auth->owner_id);
if($channel) {
$acl = new \Zotlabs\Access\AccessList($channel);
@@ -324,8 +324,13 @@ class Browser extends DAV\Browser\Plugin {
'$quota' => $quota,
'$channick' => $this->auth->owner_nick,
'$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,
'$return_url' => \App::$cmd,
+ '$path' => trim(str_replace('cloud/' . $this->auth->owner_nick, '', $path),'/'),
'$dragdroptext' => t('Drop files here to immediately upload')
));
}