Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Control expired member access to public page

Control expired member access to public page

Hi Stephen,

Im using OSE Membership for my website. Premium members each receive a publicly visible page that needs to be controlled by their subscription status. Eg if their subscription expires the publicly visible page needs to be blocked or redirected to home page. Currently OSE can't control this.

Do you know a way of achieving this with Chameleon?

Thank you in advance,

Oily
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Control expired member access to public page

I expect that should be possible by detecting when someone arrives on that particular page type, and also a database lookup for the status of the user whose page it is.

Is OSE Membership a commercial component? Is it GPL? If GPL, can you please send me a copy so I can install it and examine the database structure?

Will PM you with my e-mail address.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3319 Posts
User info in posts
Administrator has disabled public posting

Re: Control expired member access to public page

Thanks Stephen! I have sent you an email.

Oily
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Control expired member access to public page

Ok, here goes. You can use this in the PHP box on the LEFT sode of the Chameleon rule. This detects if the most recent membership has expired, and makes the rule SUCCEED if it has expired. If the user does not have a subscription, or if the subscription has NOT expired, then the rule FAILS.

$member= oseRegistry :: call('member');
$member->instance($user->id, "member_id");
$memberInfo = $member->getOwnMsc('','obj');
if (empty($memberInfo)) {
  return false; // no memberships at all - rule fail.
}
$exp = strtotime($memberInfo[0]->expired_date);
  if ($exp < time()) return true; // expired - rule succeed
}
return false; // valid and not expired - rule fail.


Hope that helps,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3319 Posts
User info in posts
Administrator has disabled public posting

Re: Control expired member access to public page

Hi Stephen, Excellent. Thank you so much. I know you are SUPER busy, so do really appreciate your help. Will keep you posted. With gratitude,

Oily
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1674
Total Polls:
6
Total Posts:
5917
Total Posts Today:
5
User Info:
 
Total Users:
11540
Newest User:
caron5112
Members Online:
0
Guests Online:
204

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked