aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2014-06-24 21:32:31 +1000
committerRedMatrix <info@friendica.com>2014-06-24 21:32:31 +1000
commita92fb0b04c3e6474ec48faf8e4cc65c382e89d66 (patch)
treed47a527d6e537ac94eed911afee6056fa1005d92 /mod
parentb2b47dcd7ca823bacd5d223666c8603d099116ec (diff)
parent4c78c3bdee5ac6c70f4de7886734e6ef06b37a26 (diff)
downloadvolse-hubzilla-a92fb0b04c3e6474ec48faf8e4cc65c382e89d66.tar.gz
volse-hubzilla-a92fb0b04c3e6474ec48faf8e4cc65c382e89d66.tar.bz2
volse-hubzilla-a92fb0b04c3e6474ec48faf8e4cc65c382e89d66.zip
Merge pull request #503 from tuscanhobbit/master
Fixes to links and forward URLs in filestorage
Diffstat (limited to 'mod')
-rw-r--r--mod/filestorage.php53
1 files changed, 7 insertions, 46 deletions
diff --git a/mod/filestorage.php b/mod/filestorage.php
index bcf798e7b..6a7eac706 100644
--- a/mod/filestorage.php
+++ b/mod/filestorage.php
@@ -26,12 +26,12 @@ function filestorage_post(&$a) {
attach_change_permissions($channel_id,$resource,$str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny,$recurse = false);
+ //Build directory tree and redirect
+ $channel = $a->get_channel();
+ $cloudPath = get_parent_cloudpath($channel_id, $channel['channel_address'], $resource) ;
+ goaway($cloudPath);
}
-
-
-
-
function filestorage_content(&$a) {
if(argc() > 1)
@@ -83,12 +83,12 @@ function filestorage_content(&$a) {
);
if(! $r) {
notice( t('File not found.') . EOL);
- goaway(z_root() . '/filestorage/' . $which);
+ goaway(z_root() . '/cloud/' . $which);
}
attach_delete($owner,$r[0]['hash']);
- goaway(z_root() . '/filestorage/' . $which);
+ goaway(z_root() . '/cloud/' . $which);
}
@@ -139,45 +139,6 @@ function filestorage_content(&$a) {
return $o;
}
- $r = q("select * from attach where uid = %d order by edited desc",
- intval($owner)
- );
-
- $files = null;
-
- if($r) {
- $files = array();
- foreach($r as $rr) {
- $files[$rr['id']][] = array(
- 'id' => $rr['id'],
- 'download' => $rr['hash'],
- 'title' => $rr['filename'],
- 'size' => $rr['filesize'],
- 'rev' => $rr['revision'],
- 'dir' => (($rr['flags'] & ATTACH_FLAG_DIR) ? true : false)
- );
- }
- }
-
- $limit = service_class_fetch ($owner,'attach_upload_limit');
- $r = q("select sum(filesize) as total from attach where aid = %d ",
- intval($channel['channel_account_id'])
- );
- $used = $r[0]['total'];
-
- $url = z_root() . "/filestorage/" . $which;
- return $o . replace_macros(get_markup_template("filestorage.tpl"), array(
- '$baseurl' => $url,
- '$download' => t('Download'),
- '$files' => $files,
- '$channel' => $which,
- '$edit' => t('Edit'),
- '$delete' => t('Delete'),
- '$used' => $used,
- '$usedlabel' => t('Used: '),
- '$directory' => t('[directory]'),
- '$limit' => $limit,
- '$limitlabel' => t('Limit: '),
- ));
+ goaway(z_root() . '/cloud/' . $which);
}