aboutsummaryrefslogtreecommitdiffstats
path: root/include/api_zot.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-12-10 15:25:44 -0800
committerzotlabs <mike@macgirvin.com>2017-12-10 15:25:44 -0800
commit27bc5fa4b0f66c47f668c6c6efda77f9732bb603 (patch)
treec94bddd5f8600508a3cf8008c2d8f98d879533ee /include/api_zot.php
parentad6cb63e0762a3af3ee0340bd3df80e482c977ef (diff)
downloadvolse-hubzilla-27bc5fa4b0f66c47f668c6c6efda77f9732bb603.tar.gz
volse-hubzilla-27bc5fa4b0f66c47f668c6c6efda77f9732bb603.tar.bz2
volse-hubzilla-27bc5fa4b0f66c47f668c6c6efda77f9732bb603.zip
improvements to file import/export
Diffstat (limited to 'include/api_zot.php')
-rw-r--r--include/api_zot.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/api_zot.php b/include/api_zot.php
index aaa9ee497..54f905b4c 100644
--- a/include/api_zot.php
+++ b/include/api_zot.php
@@ -150,7 +150,11 @@
$start = ((array_key_exists('start',$_REQUEST)) ? intval($_REQUEST['start']) : 0);
$records = ((array_key_exists('records',$_REQUEST)) ? intval($_REQUEST['records']) : 0);
- $x = attach_list_files(api_user(),get_observer_hash(),$hash,$filename,$filetype,'created asc',$start,$records);
+ $since = ((array_key_exists('since',$_REQUEST)) ? datetime_convert(date_default_timezone_get(),'UTC',$_REQUEST['since']) : NULL_DATE);
+ $until = ((array_key_exists('until',$_REQUEST)) ? datetime_convert(date_default_timezone_get(),'UTC',$_REQUEST['until']) : datetime_convert());
+
+ $x = attach_list_files(api_user(),get_observer_hash(),$hash,$filename,$filetype,'created asc',$start,$records, $since, $until);
+
if($start || $records) {
$x['start'] = $start;
$x['records'] = count($x['results']);
@@ -226,7 +230,10 @@
if(! $_REQUEST['file_id'])
return false;
- $ret = attach_export_data(api_user(),$_REQUEST['file_id']);
+ $channel = channelx_by_n(api_user());
+
+ $ret = attach_export_data($channel,$_REQUEST['file_id']);
+
if($ret) {
json_return_and_die($ret);
}