Commit d2b106b1 authored by friendica's avatar friendica

disable external content posting completely if view_stream permissions do not...

disable external content posting completely if view_stream permissions do not allow the content to be seen
parent 4d8efb51
No preview for this file type
......@@ -9,6 +9,8 @@
* Author: Cat Gray <https://free-haven.org/profile/catness>
*/
require_once('include/permissions.php');
function dwpost_load() {
register_hook('post_local', 'addon/dwpost/dwpost.php', 'dwpost_post_local');
register_hook('notifier_normal', 'addon/dwpost/dwpost.php', 'dwpost_send');
......@@ -28,7 +30,7 @@ function dwpost_unload() {
function dwpost_jot_nets(&$a,&$b) {
if(! local_user())
if((! local_user()) || (! perm_is_allowed(local_user(),'','view_stream')))
return;
$dw_post = get_pconfig(local_user(),'dwpost','post');
......@@ -146,8 +148,8 @@ function dwpost_send(&$a,&$b) {
if($b['item_restrict'] || $b['item_private'] || ($b['created'] !== $b['edited']))
return;
if(! perm_is_allowed($b['uid'],'','view_stream'))
return;
if(! perm_is_allowed($b['uid'],'','view_stream'))
return;
if(! strstr($b['postopts'],'dwpost'))
return;
......
No preview for this file type
......@@ -9,6 +9,8 @@
* Author: Cat Gray <https://free-haven.org/profile/catness>
*/
require_once('include/permissions.php');
function ijpost_load() {
register_hook('post_local', 'addon/ijpost/ijpost.php', 'ijpost_post_local');
register_hook('notifier_normal', 'addon/ijpost/ijpost.php', 'ijpost_send');
......@@ -28,7 +30,7 @@ function ijpost_unload() {
function ijpost_jot_nets(&$a,&$b) {
if(! local_user())
if((! local_user()) || (! perm_is_allowed(local_user(),'','view_stream')))
return;
$ij_post = get_pconfig(local_user(),'ijpost','post');
......@@ -144,8 +146,8 @@ function ijpost_send(&$a,&$b) {
if($b['item_restrict'] || $b['item_private'] || ($b['created'] !== $b['edited']))
return;
if(! perm_is_allowed($b['uid'],'','view_stream'))
return;
if(! perm_is_allowed($b['uid'],'','view_stream'))
return;
if(! strstr($b['postopts'],'ijpost'))
return;
......
No preview for this file type
......@@ -7,6 +7,8 @@
* Author: Tony Baldwin <https://red.free-haven.org/channel/tony>
*/
require_once('include/permissions.php');
function libertree_load() {
register_hook('post_local', 'addon/libertree/libertree.php', 'libertree_post_local');
register_hook('notifier_normal', 'addon/libertree/libertree.php', 'libertree_send');
......@@ -25,7 +27,7 @@ function libertree_unload() {
function libertree_jot_nets(&$a,&$b) {
if(! local_user())
if((! local_user()) || (! perm_is_allowed(local_user(),'','view_stream')))
return;
$ltree_post = get_pconfig(local_user(),'libertree','post');
......@@ -142,7 +144,7 @@ function libertree_send(&$a,&$b) {
if($b['item_restrict'] || $b['item_private'] || ($b['created'] !== $b['edited']))
return;
if(! perm_is_allowed($b['uid'],'','view_stream'))
if(! perm_is_allowed($b['uid'],'','view_stream'))
return;
if(! strstr($b['postopts'],'libertree'))
......
No preview for this file type
......@@ -9,6 +9,8 @@
* Author: Cat Gray <https://free-haven.org/profile/catness>
*/
require_once('include/permissions.php');
function ljpost_load() {
register_hook('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local');
register_hook('notifier_normal', 'addon/ljpost/ljpost.php', 'ljpost_send');
......@@ -28,7 +30,7 @@ function ljpost_unload() {
function ljpost_jot_nets(&$a,&$b) {
if(! local_user())
if((! local_user()) || (! perm_is_allowed(local_user(),'','view_stream')))
return;
$lj_post = get_pconfig(local_user(),'ljpost','post');
......@@ -144,8 +146,8 @@ function ljpost_send(&$a,&$b) {
if($b['item_restrict'] || $b['item_private'] || ($b['created'] !== $b['edited']))
return;
if(! perm_is_allowed($b['uid'],'','view_stream'))
return;
if(! perm_is_allowed($b['uid'],'','view_stream'))
return;
if(! strstr($b['postopts'],'ljpost'))
return;
......
No preview for this file type
......@@ -5,8 +5,10 @@
* Version: 0.1
* Author: Michael Vogel <http://pirati.ca/profile/heluecht>
*/
require('addon/pumpio/oauth/http.php');
require('addon/pumpio/oauth/oauth_client.php');
require_once('addon/pumpio/oauth/http.php');
require_once('addon/pumpio/oauth/oauth_client.php');
require_once('include/permissions.php');
define('PUMPIO_DEFAULT_POLL_INTERVAL', 5); // given in minutes
......@@ -157,7 +159,7 @@ function pumpio_connect($a) {
}
function pumpio_jot_nets(&$a,&$b) {
if(! local_user())
if((! local_user()) || (! perm_is_allowed(local_user(),'','view_stream')))
return;
$pumpio_post = get_pconfig(local_user(),'pumpio','post');
......@@ -320,8 +322,8 @@ function pumpio_send(&$a,&$b) {
if($b['item_restrict'] || $b['item_private'] || ($b['created'] !== $b['edited']))
return;
if(! perm_is_allowed($b['uid'],'','view_stream'))
return;
if(! perm_is_allowed($b['uid'],'','view_stream'))
return;
if(! strstr($b['postopts'],'pumpio'))
return;
......
No preview for this file type
......@@ -10,6 +10,7 @@
* Red to Red
*/
require_once('include/permissions.php');
function redred_load() {
// we need some hooks, for the configuration and for sending tweets
......@@ -32,8 +33,8 @@ function redred_unload() {
}
function redred_jot_nets(&$a,&$b) {
if(! local_user())
return;
if((! local_user()) || (! perm_is_allowed(local_user(),'','view_stream')))
return;
$redred_post = get_pconfig(local_user(),'redred','post');
if(intval($redred_post) == 1) {
......
No preview for this file type
......@@ -10,6 +10,7 @@
* Red to Friendica
*/
require_once('include/permissions.php');
function rtof_load() {
// we need some hooks, for the configuration and for sending tweets
......@@ -32,8 +33,8 @@ function rtof_unload() {
}
function rtof_jot_nets(&$a,&$b) {
if(! local_user())
return;
if((! local_user()) || (! perm_is_allowed(local_user(),'','view_stream')))
return;
$rtof_post = get_pconfig(local_user(),'rtof','post');
if(intval($rtof_post) == 1) {
......
No preview for this file type
......@@ -6,6 +6,8 @@
* Author: Tobias Diekershoff <http://diekershoff.homeunix.net/friendika/profile/tobias>
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
*/
require_once('include/permissions.php');
/* StatusNet Plugin for Friendica
*
......@@ -128,8 +130,8 @@ function statusnet_unload() {
}
function statusnet_jot_nets(&$a,&$b) {
if(! local_user())
return;
if((! local_user()) || (! perm_is_allowed(local_user(),'','view_stream')))
return;
$statusnet_post = get_pconfig(local_user(),'statusnet','post');
if(intval($statusnet_post) == 1) {
......@@ -571,6 +573,9 @@ function statusnet_post_hook(&$a,&$b) {
if($b['item_restrict'] || $b['item_private'] || ($b['created'] !== $b['edited']))
return;
if(! perm_is_allowed($b['uid'],'','view_stream'))
return;
if(! strstr($b['postopts'],'statusnet'))
return;
......
No preview for this file type
......@@ -7,6 +7,8 @@
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
*/
require_once('include/permissions.php');
function wppost_load () {
register_hook('post_local', 'addon/wppost/wppost.php', 'wppost_post_local');
register_hook('notifier_normal', 'addon/wppost/wppost.php', 'wppost_send');
......@@ -26,7 +28,7 @@ function wppost_unload () {
function wppost_jot_nets(&$a,&$b) {
if(! local_user())
if((! local_user()) || (! perm_is_allowed(local_user(),'','view_stream')))
return;
$wp_post = get_pconfig(local_user(),'wppost','post');
......@@ -158,8 +160,8 @@ function wppost_send(&$a,&$b) {
if($b['item_restrict'] || $b['item_private'] || ($b['created'] !== $b['edited']))
return;
if(! perm_is_allowed($b['uid'],'','view_stream'))
return;
if(! perm_is_allowed($b['uid'],'','view_stream'))
return;
if(! strstr($b['postopts'],'wppost'))
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment