Only let local logins install webpage elements
This commit is contained in:
parent
3ec2dc81f2
commit
b7d3eb1605
@ -174,10 +174,14 @@ function bb_parse_app($match) {
|
|||||||
function bb_parse_element($match) {
|
function bb_parse_element($match) {
|
||||||
$j = json_decode(base64url_decode($match[1]),true);
|
$j = json_decode(base64url_decode($match[1]),true);
|
||||||
|
|
||||||
if ($j) {
|
if ($j && local_channel()) {
|
||||||
$text = sprintf( t('Install %s element: '), translate_design_element($j['type'])) . $j['pagetitle'];
|
$text = sprintf( t('Install %s element: '), translate_design_element($j['type'])) . $j['pagetitle'];
|
||||||
$o = EOL . '<a href="#" onclick="importElement(\'' . $match[1] . '\'); return false;" >' . $text . '</a>' . EOL;
|
$o = EOL . '<a href="#" onclick="importElement(\'' . $match[1] . '\'); return false;" >' . $text . '</a>' . EOL;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$text = sprintf( t('This post contains an installable %s element, however you lack permissions to install it on this site.' ), translate_design_element($j['type'])) . $j['pagetitle'];
|
||||||
|
$o = EOL . $text . EOL;
|
||||||
|
}
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user