dowload file IF file is belongs to a specific set AND logged ind user belongs to a specific Group.
Permalink 1 user found helpful
Hello there, i am trying to make a script where users associated to a specific group can download files associated to specific set.
And if not user is, he is simply redirectet to another page.
So something like this :p
If file-getFileSet("some set") = 1
and user-getUserGroup("some group") = 1
then...
Here is what i got...
I'm trying my way out at the bottom og this file:
concrete/controllers/download_file.php
Can anyone please give me a hint on how to do this?
I have tried a bunch of things with this, but i am no php shark.
$file->getFileSets()
Hope you can help!
And if not user is, he is simply redirectet to another page.
So something like this :p
If file-getFileSet("some set") = 1
and user-getUserGroup("some group") = 1
then...
Here is what i got...
I'm trying my way out at the bottom og this file:
concrete/controllers/download_file.php
private function download($file,$rcID=NULL) { //$mime_type = finfo_file(DIR_FILES_UPLOADED."/".$filename); //header('Content-type: $mime_type'); // everything else lets just download $filename = $file->getFilename(); $file->trackDownload($rcID); $ci = Loader::helper('file'); $ci->forceDownload($file->getPath()); }
Can anyone please give me a hint on how to do this?
I have tried a bunch of things with this, but i am no php shark.
$file->getFileSets()
Hope you can help!
For the file: