This forum is archived. Posts are preserved for historical reference. For current help, join us on Discord.

did_not_have_permission.php

In UserSpice 4.3 and Below · Started by oscar on 2017-10-22 11:26 am · 4875 views · 1 replies

hello, I'm trying to insert a popup alert in the did_not_have_permission pages, so that it will tell the user what went wrong.

I added to the page the code:

`<html><body><script> alert("Acces denied"); </script> </body></html>

but the browser immediately jump to redirect.

If I comment the redirect in the us_helpers.php then popup appears.

I guess it is linked to the intrinsic logic of php, but I did not manage it.

I would like to edit only the did_not pages, without touching the us_helper.

How could I do it?

Thank you!
You cannot override the redirect without making the change in us_helpers...coming in 4.3 will be the ability to override functions in which you will be able to do this without editing us_helpers, but for the time being, did_not_have_permission is meant to do extra items, or change the redirect location, in advance of the redirect that the system has. The reason being: you don't want a user to access a page they have no permission to, and only display a popup they can close...they would then have access...