Hi all,
I submit this issue as "feature request" but for now I have implement the code by my own.
I'm building a website that let the users have a private folder based on TOKEN [user]. The code I wrote goes well but is not an official release so I can't update the module every time a new version is released.
The workaround is simple, I added a new field on the administration page called "WebFM user directory:", this field provide some tokens to create a subfolder on the root every time a user complete the registration and has a certain role/permission.
Obviously the users don't have the "administer webfm" permission and they can navigate only on "/root/[user]" folder.
My website is for selling digital files so I can't let users view what other users have on it's own folder.. this is why I have wrote the patch for this module..
For now it seems to goes well on my test website but the code I wrote is too scratchy but would be a good idea to insert it on the official module if possible.
If you need the .php files don't esitate to contact me.
Thanks
Andy
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | 2.12.patch | 9.8 KB | ermannob |
| #17 | webfm.patch | 11.02 KB | ermannob |
| #12 | webfm_file.patch | 18.47 KB | Mindexperiment |
| #11 | webfm.patch | 4.68 KB | Mindexperiment |
| #10 | webfm.admin_.patch | 39.75 KB | Mindexperiment |
Comments
Comment #1
HansR commentedis there any news about this and if it will be implemented in a possible upgrade?
I would love to see this feature as it would simplify my administration BIG TIME and reduce the risk on admin mistakes. (linked to a online shop)
Mindexperiment: what about your php-files? Are they easy to install or does it require php knowledge?
Comment #2
Mindexperiment commentedHi HansR,
there's no news on this feature.. For now I'm changing all the file every tiime a new update is release.. I highlighted the part to change.. In the file attached you can find the row of the changes in the 3rd line... Every changes is between "////////////..".
You can simply override the file on your "/module/webfm" folder (without ".txt")..
It's not a good way to work but I can't learn all the webFM module only to make this feature so I'm waiting for someone who already know the module and can make this feature works better.
If you want to see a demo you have to wait a bit because I'm already building my website.. Or maybe you could become an alpha-tester :O)
Hope this help
Andy
Comment #3
Mindexperiment commentedIf you want you can simply integrate the users folder feature with ubercat.. You only have to change the function below on uc_file.module at about row 1182
This grant that users can add only their own feature (file download) when they create a new product. under "/node/NUM/edit/features/file/add".. The autocomplete field shown only the files under user's folder if user is not the admin..
Hope this help..
Andy
Comment #4
HansR commentedwill be trying it out soon.... and keep you updated how it went
thanks a lot
Comment #5
HansR commentedthanks a lot Andy,
wouldn't mind being an alpha tester... everything for the greater good, huh ?
hahaha.... thanks a lot for the post... will try to code a bit further down, but will keep this as a back-up.
Comment #6
breos commentedHello Andy
I just intalled the web file manager and your modification and have a few questions about how it works.
In my web page, I will create the users manually, will disable the auto create account system.
How can I manage the creation of the user directory? Manually too? I have create a User and gave his role the access webfm permission and the directory didn't create automatically at hist first log.
What are the certain role/permission you mention in the description nedeed to create the directory?
...few hours later....
I have been working for a while with this modification...and I think it don't works or I dont understand what token means :-P
I think the function token_replace is missing or isn't working as it should :-/
...next day...
The function token_replace is missing. I have create the next function and seems to work
function token_replace($cadena, $token, $usuario) {
return str_replace ($token,$usuario->name,$cadena);
}
I'm not a programmer so I think this function isn't complete, I would like your token_replace function and the place where to copy it, please :-)
Thanks for the add-on to this awesome module
Comment #7
cweagansHi
@breos: You need the Token module installed (token_replace is in token module)
@all, if you guys can roll a patch for this as per http://drupal.org/patch/create, I'd be happy to look it over, suggest/help with any improvements, and commit :)
Comment #8
breos commentedThanks cweagans, I will test it :-)
Comment #9
Mindexperiment commentedHi breos,
you have to install this module: http://drupal.org/project/token here you can find all the function you need.. I have try with only one user and the folder create automatically..
@cweagans I try to make a patch but is the first time I do that so be patience.. :O)
@HansR if you want to be an alpha tester you need to have at least 3 or more audio tracks composed/mastered by you.. The site wants to be a revolutionary place to sell/present audio products for artists, where artists decide all the feature of their products.. If you or other people have idea or suggestion can write to: info@digitallmusic.net
Smile
Andy
Comment #10
Mindexperiment commentedI got the patch!!! YO!
Comment #11
Mindexperiment commentedComment #12
Mindexperiment commentedComment #13
deekarma commentedJust what I was looking for, subscribing.
Comment #14
Mindexperiment commentedIs there someone who's working on this??
Andy
Comment #15
aipheshi
the only way is to add the patch to the module ? is this request will be implemanted in the future version of webfm ?
because it will be great to have possibility distingate users and role...i go to test it
thx
edit: i dont have the new field in admin/settings/webfm
where i can find him ?
Comment #16
robmilne commentedI might be interested in adopting this idea if it was possible for me to see what you are changing. Your patches are not showing me exactly what you are touching in the code. I'm intending on releasing a 2.12 that contains bug fixes only so you will have to re-patch.
Comment #17
ermannob commentedI tried to play a bit with this and got a patch against 2.11 (not sure I got it right, that's my first!).
I'm attaching it here just for reference. So devs can evaluate it.
I'm going to try to generate a patch against 2.12.
Comment #18
ermannob commentedI love patching! :-P
Here's a patch against 2.12.
I hope that's good. I tested it a little.
Reopening the issue, so more people can test this new feature.
Comment #19
Mindexperiment commentedIt works for you? have you a live site where we can see the patch working?
=)
Comment #20
ermannob commentedI have no live sites using your patch yet. I'm evaluating it for a potential project.
Thanks for your efforts!
Comment #21
davidir81 commentedgreat patch. thanks to post it!
We've been looking for a functionality like you patched, but when the user wants to see the files of his directory he can't see it. He has the permissions to view files with WebFilemanager. Any ideas?
Thanks for your work!
PD: If the user uploads a file, he can see it. But if you copy files with copy&pasto to the directory he can't see them. HE can see them if he has the permissions to manage.
Comment #22
davidir81 commentedHi guys,
We need to upload files by directories instead from the upload mothod. There's something that cron can insert to database this files? or something to change in the code to let to list the dir instead of the database records?
Thanks a lot!
David
Comment #23
cgmonroe commentedFYI - This is a separate issue from the one it's posted under.
By "Upload directories", I think you mean that a user specifies the directory name and all files in it get uploaded. This is impossible to do with JavaScript and standard HTML because it would violate the standard security model. E.g., in order to get the list of files to "attach", JS would have to be able to read the local hard drive info. If this was allowed, hackers could have web pages that secretly got a lot of information about people they shouldn't have.
Plus, the way that HTML uploads files is very inefficient. If there were a lot of files in that directory, it could either bog down the server (CPU and memory usage) while the upload is being processed or cause end user problems when the upload process timed out due to too much time used on the page.
If you need to bulk upload files, it's better to use standard file transfer programs like FTP or SCP that are designed to do this.
Once the files are in the WebFM directory on the server, you will need to add them to the "database". (WebFM Admin option). I don't think there is a current cron option to add these. But it might not be too hard to add the "insert" case code from the webfm_ajax function to a cron function.
Comment #24
davidir81 commentedHi my friend,
the webFM has a new release in dev, that it's interesting to insert files to db with cron. Do you have planned to do a patch wit it?
Thanks,
David
Comment #25
rdeboerSomething similar is now available as a patch to 6.x-2-12. See #863346: User-private upload directories
Comment #26
nallasivamkn commentedHi all,
I am very new to Webfm. I want add two more columns in webfm front end display... currently it is displaying Name, Modified, Size and Owner of the file, but i want to add two more columns. One is for displaying the file created date and another one is for user, who last modified that file....
Can anyone help me....
Thanks in advance....
Comment #27
tazus commentedsubscribe
Comment #28
loziofabio commentedHi everybody,
I'm testing this patch on Drupal 6.9 with WebFM 6.x-2.11 and Token 6.x-1.16....
Everything seems fine with directory configuration and user creation, I just can't restrict users to access their own directory only: any user gets access to any directory.
In WebFM administration I set a role-based directory called "Public" containing all user-based sub-directories, named after each user (Public/[user])....
When a new user logs in for the first time the new directory is correctly created, but he/she has view/download access to any other sub-directory under Public folder...
Anybody has a clue on how to fix this?
Thanx
Comment #29
nhck commented