Login / Register to download attachment link to anonymous users

gauravkhambhala - February 26, 2009 - 19:05
Project:Web File Manager
Version:6.x-2.10-rc4
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Can we have Login/Register link to anonymous users instead of showing nothing as they don't have permission to see webfm attachments ?

#1

gauravkhambhala - March 2, 2009 - 10:05

Basically when user don't have permission to download, they should be able to see the file and Login/Register to download message.

#2

kenorb - June 3, 2009 - 11:39

Basically Showing trees and Downloading for Anonymous doesn't work at all.
See here: #475294: No trees found in Public access

#3

simplyrahul - July 3, 2009 - 05:54

I was looking for the same thing

If using CCK - goto file_formatter.inc in filefield folder in module

and paste the following code at the bottom

global $user;
if ($user->uid == 0) {
$url = "";
$link_text = "You must register or login to download attachments.";
}

  return '<div class="filefield-file clear-block">'. $icon . l($link_text, $url, $options) .'</div>';
}

I do not know how safe it it. But it worked for me. And it seems to be fine.

 
 

Drupal is a registered trademark of Dries Buytaert.