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.

 

PHP Syntax checking sobi2 details and user type for redirect

PHP Syntax checking sobi2 details and user type for redirect

G'day,
I'm certain I'm suffering from finger trouble and middle age stupidity smile
Old site I've gone back to after some time - J1.5.26 and MMPro.
Ultimately I want to redirect users who are not logged in or are registered to a sorry page (article id 103) when they try to view sobi2 detail task.  Everyone from author and above should be allowed to see the detail page.
Initially I'm testing proof of idea with this code knowing it should only allow authors to see the page.

Code:


$app = &JFactory::getApplication();

if  (
$option == 'com_sobi2'
and JRequest::getVar('sobi2Task') == 'sobi2Details'
and MM_NOT_USER_AUTHOR )
$app->redirect("index.php?option=com_content&view=article&id=103&Itemid=132");

With the above in place it's redirecting everybody to the sorry page.
If I replace MM_NOT_USER_AUTHOR with MM_NOT_LOGGED_IN then that works as one would expect - anyone logged in the front end can see the detail - if they're not logged in they get the sorry page.

I'm certain I've got it wrong just can't see the wood for the trees.

All help much appreciated.

Nick

nicodemus
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: PHP Syntax checking sobi2 details and user type for redirect

Hi Nick,

the expression is MM_USER_NOT_AUTHOR, not "MM_NOT_USER_AUTHOR" which you were using smile

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
3329 Posts
User info in posts
Administrator has disabled public posting

Re: PHP Syntax checking sobi2 details and user type for redirect

Hi Stephen,
lol DOH!  Of course!

Apologies for using up your time.
Many thanks from a somewhat snowy UK.
Nick

nicodemus
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: PHP Syntax checking sobi2 details and user type for redirect

That takes me back to my years in Glasgow... except it was more icy than snowy most of the time.

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
3329 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1689
Total Polls:
6
Total Posts:
5941
Posts this week:
1
User Info:
 
Total Users:
5349
Newest User:
tony55549
Members Online:
0
Guests Online:
124

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