From: friendica Date: Sun, 6 May 2012 02:54:03 +0000 (-0700) Subject: Ability to restrict Facebook fiend linking on a site. This is provided as a plugin... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0e778309db3d44ebd44e309116c63448fd5a58df;p=friendica-addons.git Ability to restrict Facebook fiend linking on a site. This is provided as a plugin so that it can be seen in a public site addon list. --- diff --git a/facebook.tgz b/facebook.tgz index 332bf0c7..ca4a858c 100644 Binary files a/facebook.tgz and b/facebook.tgz differ diff --git a/facebook/facebook.php b/facebook/facebook.php index 9c079a26..2c48c7aa 100644 --- a/facebook/facebook.php +++ b/facebook/facebook.php @@ -430,6 +430,10 @@ function facebook_post(&$a) { $uid = local_user(); if($uid){ + + $fb_limited = get_config('facebook','restrict'); + + $value = ((x($_POST,'post_by_default')) ? intval($_POST['post_by_default']) : 0); set_pconfig($uid,'facebook','post_by_default', $value); @@ -445,7 +449,13 @@ function facebook_post(&$a) { set_pconfig($uid,'facebook','blocked_apps',escape_tags(trim($_POST['blocked_apps']))); $linkvalue = ((x($_POST,'facebook_linking')) ? intval($_POST['facebook_linking']) : 0); - set_pconfig($uid,'facebook','no_linking', (($linkvalue) ? 0 : 1)); + + if($fb_limited) { + if($linkvalue == 0) + set_pconfig($uid,'facebook','no_linking', 1); + } + else + set_pconfig($uid,'facebook','no_linking', (($linkvalue) ? 0 : 1)); // FB linkage was allowed but has just been turned off - remove all FB contacts and posts @@ -496,6 +506,9 @@ function facebook_content(&$a) { info( t('Updating contacts') . EOL); } + + $fb_limited = get_config('facebook','restrict'); + $o = ''; $fb_installed = false; @@ -549,6 +562,15 @@ function facebook_content(&$a) { $no_linking = get_pconfig(local_user(),'facebook','no_linking'); $checked = (($no_linking) ? '' : ' checked="checked" '); + if($fb_limited) { + if($no_linking) { + $o .= EOL . '' . t('Facebook friend linking has been disabled on this site. The following settings will have no effect.') . '' . EOL; + $checked .= " disabled "; + } + else { + $o .= EOL . '' . t('Facebook friend linking has been disabled on this site. If you disable it, you will be unable to re-enable it.') . '' . EOL; + } + } $o .= '' . ' ' . t('Link all your Facebook friends and conversations on this website') . EOL ; $o .= '

' . t('Facebook conversations consist of your profile wall and your friend stream.'); diff --git a/facebook_restrict.tgz b/facebook_restrict.tgz new file mode 100644 index 00000000..7688fd8f Binary files /dev/null and b/facebook_restrict.tgz differ diff --git a/facebook_restrict/facebook_restrict.php b/facebook_restrict/facebook_restrict.php new file mode 100644 index 00000000..a30d8805 --- /dev/null +++ b/facebook_restrict/facebook_restrict.php @@ -0,0 +1,18 @@ + + */ + + +function facebook_restrict_install() { + set_config('facebook','restrict',1); +} + +function facebook_restrict_uninstall() { + set_config('facebook','restrict',0); +} +