This code works perfectly for the initial redirect i set up, but today, i am applying the exact same code with a different set of pages, and it does not seem to want to behave the same way.
I have the sales page here:
http://scrapbookcampus.com/register-ele ... -with-psp/ (for non registered members) and the index page here:
http://scrapbookcampus.com/element-creation-index/ (for the registered members).
On the sales page, i put this:
- Code: Select all
<?php if (current_user_can('access_s2member_ccap_element') && !current_user_can('administrator')){ ?><script type="text/javascript">window.location = http://scrapbookcampus.com/element-creation-index/';</script><?php } else {?><?php } ?>
and on the index page, i put this:
- Code: Select all
<?php if (!current_user_can('access_s2member_ccap_element') && !current_user_can('administrator')){ ?><script type="text/javascript">window.location = 'http://scrapbookcampus.com/register-element-tutorials-with-psp/';</script><?php } else {?><?php } ?>
If i am a logged in member without proper ccaps access, i get redirected from the index to the registration page.
If i am logged in as a registered member with access to the ccaps "element" i am NOT redirected from the registration page to the Index page.
Am i missing something? Is there a little detail missing in the code?