I have a process that puts files into the directory managed by webfm via ftp. My admin user can see these files automatically, but my roles that have been configured to have read-only access cannot see them.

As admin I have to insert into the database in order for these limited roles to be able to see the files. Is there a way to create a cron job that kicks of the "recursively add to database" on the root directory periodically so the users can see these files?

Thank you

Comments

displaced80’s picture

I'd be very interested in this too.

In webfm_file.inc, there are php routines to insert individual files and to insert directories recursively into the database:

function webfm_insert_file($path, &$err_arr)
* @param string  $path - path relative to drupal root
* @param string &$err_arr - ref to error array for client feedback

function webfm_insert_dir($path, $recur, &$err_arr){
* @param string  $path - path relative to drupal root
* @param bool    $recur - flag to indicate if recursive operation into sub-dirs
* @param string &$err_arr - ref to error array for client feedback

I wonder if these could be called outside of drupal? There would be a problem in that the functions would be running outside of the drupal/webfm context, so it might not have all the library functions and variables available to them.

My current homebrew PHP file browser simply reflects the filesystem structure (it's not even a drupal module). So that system quite happily shows files dropped into the filesystem via ftp or other methods. I'd really love a way to make this happen in WebFM too.

Regards,
Chris

joshfromdallas’s picture

I could use this as well, I have been trying to add that to the cron.php, but it does not work

Anyone know of an easy way to do the db update without logging in as the admin and hitting the button?

Or perhaps another module?

I need operators to add file via ftp to user folders and then the users login and download or view thier files. WebFM works great but the operator will have to copy with ftp then login to the site and do a recursive update. There has to be away to have Drupal run the recusive update on the webfm folder every X minutes?

Any Ideas?

mat.’s picture

I am really interested in this issue too.

I do not understand, role with "administer webfm" permission can see all files in WebFM immediately (after import via FTP), but for "access webfm" permission is need to add files to database. I think it could be very useful without this (for me) pointless extra step...

Is it a bug..?

robmilne’s picture

Status: Active » Fixed

In head

Status: Fixed » Closed (fixed)

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