aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-06-18 20:44:59 -0700
committerzotlabs <mike@macgirvin.com>2018-06-18 20:44:59 -0700
commit48a25b1b858b5d43eb64e1e45e0c8ad850957e4e (patch)
tree9198291ec0ce5c931f5b9708f2e6ad329f26e2ec
parentd448742ae5059ad4aa6e3381b91e4c0e3b9d7766 (diff)
downloadvolse-hubzilla-48a25b1b858b5d43eb64e1e45e0c8ad850957e4e.tar.gz
volse-hubzilla-48a25b1b858b5d43eb64e1e45e0c8ad850957e4e.tar.bz2
volse-hubzilla-48a25b1b858b5d43eb64e1e45e0c8ad850957e4e.zip
channel sources: add 'resend' option to discard original author - similar to the Friendica remote_self setting
-rw-r--r--Zotlabs/Module/Sources.php17
-rw-r--r--view/tpl/sources_edit.tpl1
-rw-r--r--view/tpl/sources_new.tpl1
3 files changed, 13 insertions, 6 deletions
diff --git a/Zotlabs/Module/Sources.php b/Zotlabs/Module/Sources.php
index a180d9b6e..91e2efa60 100644
--- a/Zotlabs/Module/Sources.php
+++ b/Zotlabs/Module/Sources.php
@@ -12,12 +12,13 @@ class Sources extends \Zotlabs\Web\Controller {
return '';
$source = intval($_REQUEST['source']);
- $xchan = $_REQUEST['xchan'];
+ $xchan = escape_tags($_REQUEST['xchan']);
$abook = intval($_REQUEST['abook']);
- $words = $_REQUEST['words'];
+ $words = escape_tags($_REQUEST['words']);
+ $resend = intval($_REQUEST['resend']);
$frequency = $_REQUEST['frequency'];
- $name = $_REQUEST['name'];
- $tags = $_REQUEST['tags'];
+ $name = escape_tags($_REQUEST['name']);
+ $tags = escape_tags($_REQUEST['tags']);
$channel = \App::get_channel();
@@ -38,6 +39,8 @@ class Sources extends \Zotlabs\Web\Controller {
return;
}
+ set_abconfig(local_channel(),$xchan, 'system','rself',$resend);
+
if(! $source) {
$r = q("insert into source ( src_channel_id, src_channel_xchan, src_xchan, src_patt, src_tag )
values ( %d, '%s', '%s', '%s', '%s' ) ",
@@ -69,7 +72,7 @@ class Sources extends \Zotlabs\Web\Controller {
}
- function get() {
+ function get() {
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return '';
@@ -110,7 +113,7 @@ class Sources extends \Zotlabs\Web\Controller {
'$words' => array( 'words', t('Only import content with these words (one per line)'),'',t('Leave blank to import all public content')),
'$name' => array( 'name', t('Channel Name'), '', ''),
'$tags' => array('tags', t('Add the following categories to posts imported from this source (comma separated)'),'',t('Optional')),
-
+ '$resend' => [ 'resend', t('Resend posts with this channel as author'), 0, t('Copyrights may apply'), [ t('No'), t('Yes') ]],
'$submit' => t('Submit')
));
return $o;
@@ -145,6 +148,8 @@ class Sources extends \Zotlabs\Web\Controller {
'$xchan' => $r[0]['src_xchan'],
'$abook' => $x[0]['abook_id'],
'$tags' => array('tags', t('Add the following categories to posts imported from this source (comma separated)'),$r[0]['src_tag'],t('Optional')),
+ '$resend' => [ 'resend', t('Resend posts with this channel as author'), get_abconfig(local_channel(), $r[0]['xchan_hash'],'system','rself'), t('Copyrights may apply'), [ t('No'), t('Yes') ]],
+
'$name' => array( 'name', t('Channel Name'), $r[0]['xchan_name'], ''),
'$submit' => t('Submit')
));
diff --git a/view/tpl/sources_edit.tpl b/view/tpl/sources_edit.tpl
index 61f6e8cb0..094440ee7 100644
--- a/view/tpl/sources_edit.tpl
+++ b/view/tpl/sources_edit.tpl
@@ -8,6 +8,7 @@
<input type="hidden" id="id_abook" name="abook" value="{{$abook}}" />
{{include file="field_input.tpl" field=$name}}
{{include file="field_input.tpl" field=$tags}}
+{{include file="field_checkbox.tpl" field=$resend}}
{{include file="field_textarea.tpl" field=$words}}
<div class="sources-submit-wrapper" >
diff --git a/view/tpl/sources_new.tpl b/view/tpl/sources_new.tpl
index bbc22df84..7cda9998d 100644
--- a/view/tpl/sources_new.tpl
+++ b/view/tpl/sources_new.tpl
@@ -7,6 +7,7 @@
<input type="hidden" id="id_abook" name="abook" value="{{$abook}}" />
{{include file="field_input.tpl" field=$name}}
{{include file="field_input.tpl" field=$tags}}
+{{include file="field_checkbox.tpl" field=$resend}}
{{include file="field_textarea.tpl" field=$words}}
<div class="sources-submit-wrapper" >