Project:Web File Manager
Version:6.x-2.10-rc5
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)
Issue tags:Drupal 6, OG, Organic Groups, WebFM

Issue Summary

I'm working on integrating webfm with OG. My approach is to mirror the logic which exists for roles to work for groups as well. A folder can exist for each group and its members can access the folder. I also added a setting to create a new folder automatically when a new group is created.

I have a start which appears to be working but is in need of testing.

AttachmentSize
webfm-og.patch9.04 KB

Comments

#1

Version:5.x-2.12» 5.x-2.13

Hi. I've been desperately looking for how to get OG level permissioning into WebFM and came across this patch.

I've just started to see if this will work for me. Not really a coder but I managed to merge your patch into the current WebFM 2.13 module.

Seems to be working quite well which is great news. One issue I've found is that if you allow WebFM to auto create directories on new group creation, I get problems when the group title has spaces in it. It creates the directory ok (at least on a MAMP test system) but then can't upload anything into that directory using WebFM.

I changed 2 lines in function webfm_nodeapi(&$node, $op, $teaser) - basically doing a string replace on the spaces with underscores for the title, so:
$group_root_dir = file_directory_path() .'/'. variable_get('webfm_root_dir', '')."/".str_replace(' ','_', $node->title)
and
variable_set('root_dir_group_'. $node->nid, str_replace(' ','_', $node->title))

Maybe there's a better way of doing this that will also take care of other characters not allowed in directory names?

Have you worked any more on this functionality and if so, do you have an updated patch file?

Thanks!

#2

Thanks Piyush

Attached is a new patch against 5.x-2.13. I added some code to get rid of spaces and other non-alphanumeric characters when the folder is created in the group.

Thanks for testing. So far it's working for me but it definitely needs more testing and refining.

AttachmentSize
249487-webfm-og-3.patch 9.4 KB

#3

Piyush found a bug in my last patch related to the sanitizing of group names, so here's the latest patch.

AttachmentSize
249487-webfm-og.patch 11.53 KB

#4

I wish I could test this but I don't have enough time - Maybe Andre? I'd like to give webfm some cycles again someday.

#5

I can take a look once the jquerification of the client side is complete - though my OG experience is limited - i'm sure I can review the patch.

#6

Can anybody tell me how to incorporate this patch into drupal website??

How do i include this patch into my module?

As i am new to drupal so sorry for asking such a question.

#7

Is there any way I can integrate this module with a panel layout inside OG? I was previously using OG Files but that's pretty limited. However, it does provide a tabbed page that can be integrated with a Blueprint of other tabbed pages in a OG group layout.

Is there any way I can do this with WebFM too? I can build a Panels page with a list of previously uploaded files but I really want to embed the whole shebang into a panel page. Do I need to write a specific content type to handle this?

Thanks in advance for any help.

#8

#9

Version:5.x-2.13» 5.x-2.15

what a wonderful patch! I have tested it with og 8.x and seems to work properly.
Here I provide an extended version of the patch, which provides a tab to every og node (group homepage) and also webfm root path is jailed to corresponding group's file path(user will only see files corresponding to her group).

Blessings!

AttachmentSize
webfm-og-v2.patch 13.55 KB

#10

Hey, this is a great function! Are there any plans to port this to D6?

#11

+1 for D6 port. Great stuff

#12

Extremely useful if ported to D6; subscribing!

#13

I will work on a port to D6 if the maintainer expresses interest in committing the patch.

#14

@Jody Lynn

I doubt that, latest commit was 4 months ago, perhaps trying to contact him directly...

Blessings!

#15

I'm still alive but have been way too busy with other projects to volunteer any time. My availability may improve next month. There is such a backlog of issues I cannot promise anything.

-rob

#16

D6port++ subscribing

#17

D6port++ subscribing

#18

D6port++subscribing

#19

Now that there is a new release I'd like to see a new 6.x patch of this work for the next release.

#20

I also vote for a D6 port of this. Can contribute a small amount of testing time when its ready. Thanks.

#21

Version:5.x-2.15» 6.x-2.10-rc5
Status:needs review» needs work

Here's an untested patch for D6 og integration.

It needs thorough access testing.

AttachmentSize
webfm-og-6.patch 14.81 KB

#22

Status:needs work» needs review

#23

Just to confirm, is this patch applied to RC5?

I have never used OG so I don't feel qualified to test this. I'd appreciate it if OG users familiar with WebFM could help out in this regard. I will review security issues by looking at the code only.

-rob

#24

Yes, RC5.

I'd like someone who wants the patch to test it out with some OG groups and users. If no one does, I will eventually.

#25

I'll do it this weekend. I'll let you know how it works out

#26

Tested, seems to work pretty fine. Creates new root directories for each new group as well.

#27

Also, I don't know how hard this would be, but it'd be awesome if group admins could administrate their group directories (but not any other directory obviously)

#28

Also, this may be impossible to do, but if there is any way to have a link on the local tasks bar for each group, that'd be awesome. What would be even better is if by clicking that link, a webfm browser would show up, but it would only show that group's directory and not all the directories the user is able to see. Now that would make it a complete integration with WebFM.

#29

#27 is a variation of many previous requests for local administration rather than the current global admin. I don't have the time to implement this though I will keep it in mind.

Thanks for testing the patch. I will include in the next release - hopefully in the next few weeks.

#30

This is great. I got it patched to create the group directories automatically. Great work guys.

I really would like the feature mentioned in #28. That is exactly what I need. I'm guessing to add the link on the "taskbar" (i.e., the group details block) we'd have to patch the OG module.

I would PAY for the patch that creates a private WebFM per Organic Group, which also takes you directly to the group's directory, with no access to parent directories.

Any takers?!

#31

Status:needs review» fixed

In 6.x-2.11

#32

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#33

Hello, I have three different node types for organic groups and would like to limit the automated creation of folders in webfm for only 1 of them. I guess, it must be an if-statement (something like if ($groups[$node->type] == 'myspecialgroup') { ... }?)... but where and how exactly?

I would be very thankful if somebody could help me to get it working.

Stefan

#34

The "create subdirectory magic" is done in the webfm_nodeapi function. Look at the insert case.

Here's a quick untested way to do this is to change this section:

$groups = og_all_groups_options();
if ($groups{$node->nid] ) {
  // make the node title into a suitable directory name

to look like:

$groups = og_all_groups_options();
if ($groups{$node->nid] && $node->type == 'myspecialgroup' ) {
  // make the node title into a suitable directory name

#35

I was so close - right line, wrong code. :D

Thank you VERY MUCH for your help! You made my day! :)

#36

Status:closed (fixed)» active

Hi, How it's possible to grant Group Admin the permission to create and delete folders ?

thanks

lechuck

#37

Status:active» closed (fixed)

You should open a new issue rather than re-opening a closed one.

nobody click here