aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Impel.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-03-13 16:19:47 -0700
committerMario Vavti <mario@mariovavti.com>2017-03-29 13:32:23 +0200
commit0f7832dc30fb4d8aedd24b6ad8a9e48876a77dd0 (patch)
tree86d0d53082292dfeb2b4230b36f5675da35db36a /Zotlabs/Module/Impel.php
parent107083e3e49ddb91de7df5133fc6771721e31e10 (diff)
downloadvolse-hubzilla-0f7832dc30fb4d8aedd24b6ad8a9e48876a77dd0.tar.gz
volse-hubzilla-0f7832dc30fb4d8aedd24b6ad8a9e48876a77dd0.tar.bz2
volse-hubzilla-0f7832dc30fb4d8aedd24b6ad8a9e48876a77dd0.zip
code_allowed is a real mess. Start the cleanup by remving the account level code allow and limiting to specific channels only. This reduces the possibility of cross channel security issues coming into play. Then provide a single function for checking the code permission. This is only partially done as we often need to check against the observer or logged in channel as well as the resource owner to ensure that this only returns true for local channels which also own the requested resource.
Diffstat (limited to 'Zotlabs/Module/Impel.php')
-rw-r--r--Zotlabs/Module/Impel.php14
1 files changed, 2 insertions, 12 deletions
diff --git a/Zotlabs/Module/Impel.php b/Zotlabs/Module/Impel.php
index 197d9f859..77f488d26 100644
--- a/Zotlabs/Module/Impel.php
+++ b/Zotlabs/Module/Impel.php
@@ -144,18 +144,8 @@ class Impel extends \Zotlabs\Web\Controller {
// Verify ability to use html or php!!!
- $execflag = false;
-
- if($arr['mimetype'] === 'application/x-php') {
- $z = q("select account_id, account_roles, channel_pageflags from account left join channel on channel_account_id = account_id where channel_id = %d limit 1",
- intval(local_channel())
- );
-
- if($z && (($z[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) || ($z[0]['channel_pageflags'] & PAGE_ALLOWCODE))) {
- $execflag = true;
- }
- }
-
+ $execflag = ((intval($channel['channel_id']) == intval(local_channel()) && ($channel['channel_pageflags'] & PAGE_ALLOWCODE)) ? true : false);
+
$i = q("select id, edited, item_deleted from item where mid = '%s' and uid = %d limit 1",
dbesc($arr['mid']),
intval(local_channel())