aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-02-17 19:47:36 -0800
committerfriendica <info@friendica.com>2015-02-17 19:47:36 -0800
commite00be4de2353e1ca58570bf37fd247ff99fa549f (patch)
tree19117fb4898603af951732c1c3a3cfd72b72ff6d /mod
parent8c717f910acd0131bd4e0a31bbe47e6f03acffe9 (diff)
downloadvolse-hubzilla-e00be4de2353e1ca58570bf37fd247ff99fa549f.tar.gz
volse-hubzilla-e00be4de2353e1ca58570bf37fd247ff99fa549f.tar.bz2
volse-hubzilla-e00be4de2353e1ca58570bf37fd247ff99fa549f.zip
The Diaspora communications policies allow comments to public posts literally from anybody. Allow this policy model by default for commenters from that network. This policy decision can be set or disabled on the addon/features settings page.
Diffstat (limited to 'mod')
-rw-r--r--mod/settings.php25
1 files changed, 22 insertions, 3 deletions
diff --git a/mod/settings.php b/mod/settings.php
index 8c927a97c..2ccedcb7b 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -114,6 +114,12 @@ function settings_post(&$a) {
check_form_security_token_redirectOnErr('/settings/featured', 'settings_featured');
call_hooks('feature_settings_post', $_POST);
+
+ if($_POST['dspr-submit']) {
+ set_pconfig(local_channel(),'system','diaspora_public_comments',intval($_POST['dspr_pubcomment']));
+ info( t('Diaspora Policy Settings updated.') . EOL);
+ }
+
build_sync_packet();
return;
}
@@ -648,18 +654,31 @@ function settings_content(&$a) {
}
if((argc() > 1) && (argv(1) === 'featured')) {
$settings_addons = "";
+
+ $o = '';
+ $diaspora_enabled = get_config('system','diaspora_enabled');
$r = q("SELECT * FROM `hook` WHERE `hook` = 'feature_settings' ");
- if(! count($r))
+ if((! $r) && (! $diaspora_enabled))
$settings_addons = t('No feature settings configured');
+ if($diaspora_enabled) {
+ $pubcomments = get_pconfig(local_channel(),'system','diaspora_public_comments');
+ if($pubcomments === false)
+ $pubcomments = 1;
+ }
+
call_hooks('feature_settings', $settings_addons);
-
-
+
$tpl = get_markup_template("settings_addons.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_featured"),
'$title' => t('Feature Settings'),
+ '$diaspora_enabled' => $diaspora_enabled,
+ '$pubcomments' => $pubcomments,
+ '$dsprtitle' => t('Diaspora Policy Settings'),
+ '$dsprhelp' => t('Allow any Diaspora member to comment on your public posts.'),
+ '$dsprsubmit' => t('Submit Diaspora Policy Settings'),
'$settings_addons' => $settings_addons
));
return $o;