Merge https://github.com/redmatrix/redmatrix into pending_merge
Conflicts: include/attach.php
This commit is contained in:
commit
fc28af8518
@ -8,6 +8,7 @@ require_once("html2plain.php");
|
|||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
require_once('include/photos.php');
|
require_once('include/photos.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
require_once('include/attach.php');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@ -619,6 +620,13 @@ require_once('include/items.php');
|
|||||||
}
|
}
|
||||||
api_register_func('api/red/channel/stream','api_channel_stream', true);
|
api_register_func('api/red/channel/stream','api_channel_stream', true);
|
||||||
|
|
||||||
|
function api_attach_list(&$a,$type) {
|
||||||
|
logger('api_user: ' . api_user());
|
||||||
|
json_return_and_die(attach_list_files(api_user(),get_observer_hash()));
|
||||||
|
}
|
||||||
|
api_register_func('api/red/files','api_attach_list', true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function api_albums(&$a,$type) {
|
function api_albums(&$a,$type) {
|
||||||
json_return_and_die(photos_albums_list($a->get_channel(),$a->get_observer()));
|
json_return_and_die(photos_albums_list($a->get_channel(),$a->get_observer()));
|
||||||
|
@ -181,7 +181,7 @@ function attach_list_files($channel_id, $observer, $hash = '', $filename = '', $
|
|||||||
|
|
||||||
$ret = array('success' => false);
|
$ret = array('success' => false);
|
||||||
|
|
||||||
if(! perm_is_allowed($channel_id,$observer, 'read_storage')) {
|
if(! perm_is_allowed($channel_id,$observer, 'view_storage')) {
|
||||||
$ret['message'] = t('Permission denied.');
|
$ret['message'] = t('Permission denied.');
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
@ -203,7 +203,7 @@ function attach_list_files($channel_id, $observer, $hash = '', $filename = '', $
|
|||||||
|
|
||||||
// Retrieve all columns except 'data'
|
// Retrieve all columns except 'data'
|
||||||
|
|
||||||
$r = q("select id, aid, uid, hash, filename, filetype, filesize, revision, folder, os_storage, is_dir, is_photo, flags, created, edited, allow_cid, allow_gid, deny_cid, deny_gid from attach where uid = %d $sql_extra $orderby $limit",
|
$r = q("select id, aid, uid, hash, filename, filetype, filesize, revision, folder, os_storage, is_dir, is_photo, flags, created, edited, allow_cid, allow_gid, deny_cid, deny_gid from attach where uid = %d $sql_extra ORDER BY $orderby $limit",
|
||||||
intval($channel_id)
|
intval($channel_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user