aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-04-18 17:26:05 -0700
committerzotlabs <mike@macgirvin.com>2018-04-18 17:26:05 -0700
commita2e0706d55ee02cf665f366616ef10ff624b3bcc (patch)
tree8d019f47487af8f2f24da6f94ae42d9f9e78ce7c
parent85ccfb4bbcbd22ac234a8ac2a3d7ec2ec831ae29 (diff)
downloadvolse-hubzilla-a2e0706d55ee02cf665f366616ef10ff624b3bcc.tar.gz
volse-hubzilla-a2e0706d55ee02cf665f366616ef10ff624b3bcc.tar.bz2
volse-hubzilla-a2e0706d55ee02cf665f366616ef10ff624b3bcc.zip
relax restrictions to the design tools menu to allow those with write_pages permission; this doesn't fix the underlying modules though as there are some potential security issues at the moment.
-rw-r--r--Zotlabs/Widget/Design_tools.php13
-rw-r--r--include/text.php2
2 files changed, 4 insertions, 11 deletions
diff --git a/Zotlabs/Widget/Design_tools.php b/Zotlabs/Widget/Design_tools.php
index 8ab6a235d..a15c0c98d 100644
--- a/Zotlabs/Widget/Design_tools.php
+++ b/Zotlabs/Widget/Design_tools.php
@@ -6,16 +6,9 @@ class Design_tools {
function widget($arr) {
- // mod menu doesn't load a profile. For any modules which load a profile, check it.
- // otherwise local_channel() is sufficient for permissions.
+ if(perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),'write_pages') || (\App::$is_sys && is_site_admin()))
+ return design_tools();
- if(\App::$profile['profile_uid'])
- if((\App::$profile['profile_uid'] != local_channel()) && (! \App::$is_sys))
- return '';
-
- if(! local_channel())
- return '';
-
- return design_tools();
+ return EMPTY_STR;
}
} \ No newline at end of file
diff --git a/include/text.php b/include/text.php
index e04b51610..55fc49560 100644
--- a/include/text.php
+++ b/include/text.php
@@ -2404,7 +2404,7 @@ function jindent($json) {
*/
function design_tools() {
- $channel = App::get_channel();
+ $channel = channelx_by_n(App::$profile['profile_uid']);
$sys = false;
if(App::$is_sys && is_site_admin()) {