SimplePortal

Support => English Support => Topic started by: moal on June 28, 2014, 09:17:48 AM

Title: Incorrect message when unauthorized access to Simpel portal pages
Post by: moal on June 28, 2014, 09:17:48 AM
Hi there,

I hope you can help me. I have created some pages on SP, which I would like to make it available only to members.
For these sites there are on the home page button that can be seen by guests. I would like to have deliberately so, because it makes you curious.
Click now but a guest on one of the banners, so he does not get to Login or Sign-side as you would expect, but he gets the message "There was an error." A message which at this point is completely inappropriate, and the user is not been encouraged to register or log on, but just to leave the page. What can I do so that is directed to the correct page when groups access without permission to a SP page?

best regards moal

Sorry, I use the Google translator..
Title: Re: Incorrect message when unauthorized access to Simpel portal pages
Post by: moal on June 30, 2014, 06:45:54 AM
Can not anybody help me?
Title: Re: Incorrect message when unauthorized access to Simpel portal pages
Post by: andy on July 01, 2014, 04:28:37 AM
Unfortunately, if you do not allow guests permission to see it, this is how Simple Portal works.

Quote
An Error Has Occurred!
The page you requested cannot be found.

You would need custom code to make changes so that it would show a login page. I do not think you would get that customization here but I might be wrong.


I think the error message should say they do not have permission to view the page.


Quote
An Error Has Occurred!
You do not have permission to view this page.

In fact, I will post this as a request myself.
Title: Re: Incorrect message when unauthorized access to Simpel portal pages
Post by: moal on July 01, 2014, 04:56:13 AM
Hi Andy,
Thank you! :)

In my case, guests will receive a much shorter message:

Quote
An error has occurred!
back

Since no human can think that a registration or login would help.

best regards moal
Title: Re: Incorrect message when unauthorized access to Simpel portal pages
Post by: [SiNaN] on July 05, 2014, 06:11:20 PM
Current behavior is that of SMF's - that is, if you can't access something, you shouldn't even know that it exists. However, you can change this behavior by the following edit:

Sources/PortalPages.php

Code: (Find) [Select]
$context['SPortal']['page'] = sportal_get_pages($page_id, true, true);
Code: (Replace) [Select]
if ($user_info['is_guest'])
{
$context['SPortal']['page'] = sportal_get_pages($page_id, true, false);

if (!empty($context['SPortal']['page']['id']) && !sp_allowed_to('page', $context['SPortal']['page']['id_page']))
is_not_guest('Please login for access to the page!');
}
else
$context['SPortal']['page'] = sportal_get_pages($page_id, true, true);

You can change the "Please login for access to the page!" bit as you wish.
SimplePortal 2.3.8 © 2008-2024, SimplePortal