api extenesions for file migration

This commit is contained in:
redmatrix 2015-10-13 16:15:34 -07:00
parent 73dad85867
commit 578f1b8ece
2 changed files with 6 additions and 5 deletions

View file

@ -622,7 +622,7 @@ require_once('include/attach.php');
function api_attach_list(&$a,$type) { function api_attach_list(&$a,$type) {
logger('api_user: ' . api_user()); logger('api_user: ' . api_user());
json_return_and_die(attach_list_files(api_user(),get_observer_hash())); json_return_and_die(attach_list_files(api_user(),get_observer_hash(),'','','','created asc'));
} }
api_register_func('api/red/files','api_attach_list', true); api_register_func('api/red/files','api_attach_list', true);
@ -635,10 +635,11 @@ require_once('include/attach.php');
dbesc($_REQUEST['file_id']) dbesc($_REQUEST['file_id'])
); );
if($r) { if($r) {
$data = dbunescbin($r[0]['data']); if($r[0]['flags'] & ATTACH_FLAG_DIR) {
if($r[0]['flags'] & ATTACH_FLAG_DIR)
$r[0]['is_dir'] = '1'; $r[0]['is_dir'] = '1';
if($r[0]['flags'] & ATTACH_FLAG_OS) $r[0]['data'] = '';
}
elseif($r[0]['flags'] & ATTACH_FLAG_OS)
$r[0]['data'] = base64_encode(file_get_contents(dbunescbin($r[0]['data']))); $r[0]['data'] = base64_encode(file_get_contents(dbunescbin($r[0]['data'])));
else else
$r[0]['data'] = base64_encode(dbunescbin($r[0]['data'])); $r[0]['data'] = base64_encode(dbunescbin($r[0]['data']));

View file

@ -1 +1 @@
2015-10-12.1183 2015-10-13.1184