How to get page group owner/permission?
Permalink
My problem is I have 2 types of registration page:
1. core registration page
2. registration page specific to a group
Scenario:
When a guest tries to access a newsletter and is not part of the newsletter group (which has permission to read the newsletter page) the guest is redirected to 'newsletter' registration (No. 2).
So here's my question:
How do you get the groups that are permitted to see a page?
Thanks
1. core registration page
2. registration page specific to a group
Scenario:
When a guest tries to access a newsletter and is not part of the newsletter group (which has permission to read the newsletter page) the guest is redirected to 'newsletter' registration (No. 2).
So here's my question:
How do you get the groups that are permitted to see a page?
Thanks
Hi @PatrickCassidy thank you for that detailed how-to. But I think my problem is more on the coding side.
I wish to redirect a guest to a specific single_page which I have created. I have looked at the forbidden_page controller I think it closely answer my question. But I want to check if the page belongs to a certain group then the redirect to the customized single_page will occur.
ex.
foreach ( page.groupList as group ) {
if ( group == 'newsletter group' )
$this->redirect('/newsletter/register');
}
Is that possible?
Again thank you!
I wish to redirect a guest to a specific single_page which I have created. I have looked at the forbidden_page controller I think it closely answer my question. But I want to check if the page belongs to a certain group then the redirect to the customized single_page will occur.
ex.
foreach ( page.groupList as group ) {
if ( group == 'newsletter group' )
$this->redirect('/newsletter/register');
}
Is that possible?
Again thank you!
Ok...Now I get what you are stuck with... unfortunately I'm no PHP coder, so I can't help... Someone else on the forum can surely help? Anyone? Any takers? ;)
Hi,
Can you not just check if the user is logged in and in a specific group?
A guest wouldn't have ANY account so that is when you would redirect them.
Something like:
in your header_required.php in the elements directory.
Can you not just check if the user is logged in and in a specific group?
A guest wouldn't have ANY account so that is when you would redirect them.
Something like:
$u = new User(); if (!$u->isLoggedIn()) { header('Location: index.php/registerfornewsletter'); }
in your header_required.php in the elements directory.
2. Navigate to the page that you want to restrict.
3. Hover your mouse over EDIT in the menu bar.
4. A drop-down appears
5. Click on Permissions
6. Select the group that you want to be able view the page.
If you haven't set up groups;
1. Go to Dashboard
2. Under 'Members' heading choose 'Add Group'
3. You can assign members to that group.
Hope that helps.