Support redirect to login page when content is marked premium

acstewart - January 17, 2009 - 00:35
Project:Premium
Version:HEAD
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Issue tags:Login Redirect
Description

In addition to showing a message, it'd be useful if an admin could specify that the user go to a login / register page in order to access the content.

#1

acstewart - January 17, 2009 - 00:58

Attaching a patch for this one. Would love to see this make it in.

The patch is against the 6.x version of the module, and adds a "Redirect Url" to the premium settings page. If set, it will call drupal_set_message() with the premium message.

It also adds a hook_premium_message($premium_message, $node) so that other modules can override the specified message with more specific messaging.

For example, an audio module could display a "Log in or register to play this song!" message on the login page.

Feedback welcome!

AttachmentSize
premium_6_x_redirect.patch 1.7 KB

#2

acstewart - January 17, 2009 - 21:49
Status:active» needs review

#3

majnoona - April 6, 2009 - 17:42

sorry, wrong thread...

#4

acstewart - April 10, 2009 - 20:27

Has this patch gotten reviewed or incorporated yet?

#5

CLKeenan - May 6, 2009 - 13:36

Would you be willing to make a similar patch for 5.x?? That would be amazing!

#6

iaminawe - July 29, 2009 - 10:55

This works great... a big improvement if your content type has lots of cck fields...
Only problem is that if a view is displayed and in the listing there is a teaser that is premium content you are automatically redirected to the login screen.
The workaround I found for this was to use views with fields rather than nodes... this works fine and only when a premium article title is clicked on are you redirected to the correct screen...

#7

iaminawe - August 14, 2009 - 14:29

Actually I digress... this is now driving me crazy... although the workaround works.... every time a search is done and premium content is found in the teasers on the site, visitors are sent to the register/login page.

Can someone please help me with what code in the module (or this patch) I would need to change to make the redirection only occur when the full node is viewed. All teasers should be displayed.

Thanks in advance.

#8

iaminawe - August 27, 2009 - 10:27

Another plea for help, I really need to remove the functionality that causes the redirect on teasers... its also destroying my rss feeds...
Any ideas anyone .... getting deperate....

Thanks
Gregg

#9

iaminawe - September 11, 2009 - 12:35

Is there anyone out there out there out there?

#10

spgd01 - November 5, 2009 - 16:59

The patch works but defeats the purpose of Premium. The use never sees the teaser. They are auto redirected right away. I would like to see the page load wioththe teaser text and a link to login in the premium message. However, the link to login should appended the desired page in the url query string so that, once login is successful, the user is taken directly where they were originally trying to go. Much like
403 redirect:
http://drupal.org/project/r4032login

This can be done manually with a link to the user/login but then the user wont be redirected to the original page. Does anyone know the php code to make a link do this?

 
 

Drupal is a registered trademark of Dries Buytaert.