IT Management Portal with Technical Articles
Home
Sunday, 05 September 2010
Login Form
Username

Password

Remember me
Password Reminder
No account yet? Create one
Syndicate
DocMan 1.4 Suggesting Registration PDF Print E-mail
User Rating: / 0
PoorBest 
Tuesday, 11 September 2007
And again... an impossible mission... We need DocMan for Joomla in version 1.40RC2 to tell a user to register if he did not have rights to download an item. So we wanted users to be able to see the files available but only be able to download after a registration and subsequent login as a "Registered User".

To achieve this, we set "Guest" permissions in the "Configuration" module of Docman to "View" only. This disabled non-registered users from downloading - but they could still see the files. The document permissions stayed on "Everybody".

 Then, we changed the original template to suggest that a user registers when he lacked the permissions to download. We had to change this file:

"<joomladir>"\components\com_docman\themes\default\templates\documents\tasks.tpl.php

The area we changed initially said this:

if ( $this->theme->conf->task_download ) :

if( $this->doc->links->download ) :

?><li><a href="<?php echo $this->doc->links->download ?>"><?php echo _DML_TPL_DOC_DOWNLOAD ?></a></li><?php

endif;

endif;

The new code then reads:

if ( $this->theme->conf->task_download ) :

if( $this->doc->links->download ) :

?><li><a href="<?php echo $this->doc->links->download ?>"><?php echo _DML_TPL_DOC_DOWNLOAD ?></a></li><?php

else:

?><li><a href="./index.php?option=com_registration&task=register"><?php echo "Register to download" ?></a></li><?php

endif;

endif;

Now, whenever a user lacks permission to download a file, he'll see a button that says "Register to download" and that will point him to the registration page. Works like a champ!

Last Updated ( Tuesday, 11 September 2007 )
Polls
Are you a...
  
The dominating OS on your network is...
  
The last virus outbreak on your network was within the...
  
Who's Online
We have 9 guests online
 

Mambo is Free Software released under the GNU/GPL License.
Design by Mamboteam.com | Powered by Mambobanner.de