Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 10 Apr 2015, 06:58
MacroPhotoPro MacroPhotoPro is offline
 
Join Date: Feb 2012
RE-DIRECTING TO REGISTER Based on Permissions

Hi;

I have created custom pages that I only want subscribed (paying) members to be able to view.

If an unregistered/registered member (who has not paid) tries to view, I have created a re-direct with the following code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

User Group 1 = Unregistered;
User Group 2 = Registered;
User Group 3 = Awaiting Email;
User Group 4 = In Moderation;

However, the page is not redirecting properly.

What am I doing wrong in my coding?

Any help would be very much appreciated,

Jack

--------------- Added 10 Apr 2015 at 08:29 ---------------

Someone PM'd me this coding, and it works, but unfortunately it directs every user group to register:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

How do I code it to be specific, to one (or more) select user groups?

Would appreciate some help

Last edited by MacroPhotoPro; 10 Apr 2015 at 08:30.
Reply With Quote
  #2  
Old 10 Apr 2015, 11:55
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
If you have a usergroupid and you want to check it, you could do this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Or to check the current user you could do this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Of course you could also use !is_member_of and only list the usergorups that should have access, if that's easier.
Reply With Quote
  #3  
Old 10 Apr 2015, 16:13
MacroPhotoPro MacroPhotoPro is offline
 
Join Date: Feb 2012
Thank you very much.

How does it know to redirect the user to register.php?

--------------- Added 10 Apr 2015 at 16:22 ---------------

Could you elaborate on do redirect?

--------------- Added 10 Apr 2015 at 16:28 ---------------

Originally Posted by kh99 View Post
Of course you could also use !is_member_of and only list the usergorups that should have access, if that's easier.
I think this would be easier, would you mind showing me how to do this? This will be for a specific, customized .php page.

Thank you!

Last edited by MacroPhotoPro; 10 Apr 2015 at 16:29.
Reply With Quote
  #4  
Old 10 Apr 2015, 16:28
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
The "do redirect" comment is meant to show where you'd put the code you posted at the end of post #1.
Reply With Quote
  #5  
Old 10 Apr 2015, 16:34
MacroPhotoPro MacroPhotoPro is offline
 
Join Date: Feb 2012
You mean this?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

It doesn't seem to be working.
Reply With Quote
  #6  
Old 10 Apr 2015, 17:10
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Where are you putting that code exactly? It would only work if your custom pages include vbulletin's global.php, and that redirect code would have to be after global.php was included.
Reply With Quote
  #7  
Old 10 Apr 2015, 17:25
MacroPhotoPro MacroPhotoPro is offline
 
Join Date: Feb 2012
I have a custom vBB page, and here is where I am trying to insert the code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

--------------- Added 10 Apr 2015 at 17:32 ---------------

I think it might be easier to just list the user groups that can access the page.

What would the code be for that?

Last edited by MacroPhotoPro; 10 Apr 2015 at 17:33.
Reply With Quote
  #8  
Old 10 Apr 2015, 17:59
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Well, first we need to figure out why it's not working right. You said before that this code did the redirect but for everyone?

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


And what I suggested didn't redirect anyone?
Reply With Quote
  #9  
Old 10 Apr 2015, 18:25
MacroPhotoPro MacroPhotoPro is offline
 
Join Date: Feb 2012
I think I have it figured out. The following seems to work:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So far, so good. If I run into trouble again, I will re-post here, but I think I got it licked

Thank you for your time!

Jack

--------------- Added 10 Apr 2015 at 18:27 ---------------

PS: I would be interested to see your code where only members X, Y could have access ... with all others getting a No Permissions message.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 14:20.

Layout Options | Width: Wide Color: