diff options
author | zottel <github@zottel.net> | 2016-07-25 13:38:12 +0200 |
---|---|---|
committer | zottel <github@zottel.net> | 2016-07-25 13:38:12 +0200 |
commit | dcf2c07f298eec277b342f0ab3a5fa637285f0c0 (patch) | |
tree | 76fb6701e4edf773c5e567025becf245756d061a /Zotlabs/Module/File_upload.php | |
parent | ed82cb108f99ce45ced841161fa505ecf11ceee4 (diff) | |
parent | da512cef64be9268536626f81c0af59613aa5cdd (diff) | |
download | volse-hubzilla-dcf2c07f298eec277b342f0ab3a5fa637285f0c0.tar.gz volse-hubzilla-dcf2c07f298eec277b342f0ab3a5fa637285f0c0.tar.bz2 volse-hubzilla-dcf2c07f298eec277b342f0ab3a5fa637285f0c0.zip |
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'Zotlabs/Module/File_upload.php')
-rw-r--r-- | Zotlabs/Module/File_upload.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Zotlabs/Module/File_upload.php b/Zotlabs/Module/File_upload.php new file mode 100644 index 000000000..999b241f1 --- /dev/null +++ b/Zotlabs/Module/File_upload.php @@ -0,0 +1,40 @@ +<?php +namespace Zotlabs\Module; + +require_once('include/attach.php'); +require_once('include/channel.php'); +require_once('include/photos.php'); + + +class File_upload extends \Zotlabs\Web\Controller { + + function post() { + + // logger('file upload: ' . print_r($_REQUEST,true)); + + $channel = (($_REQUEST['channick']) ? get_channel_by_nick($_REQUEST['channick']) : null); + + if(! $channel) { + logger('channel not found'); + killme(); + } + + $_REQUEST['source'] = 'file_upload'; + + if($channel['channel_id'] != local_channel()) { + $_REQUEST['contact_allow'] = expand_acl($channel['channel_allow_cid']); + $_REQUEST['group_allow'] = expand_acl($channel['channel_allow_gid']); + $_REQUEST['contact_deny'] = expand_acl($channel['channel_deny_cid']); + $_REQUEST['group_deny'] = expand_acl($channel['channel_deny_gid']); + } + + if($_REQUEST['directory_name']) + $r = attach_mkdir($channel,get_observer_hash(),$_REQUEST); + else + $r = attach_store($channel,get_observer_hash(), '', $_REQUEST); + + goaway(z_root() . '/' . $_REQUEST['return_url']); + + } + +} |