simply protect a single page

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
pasbonte
Veteran Member
Posts: 162
Joined: 2013-02-06 09:49

simply protect a single page

Post by pasbonte » 2021-03-08 10:50

Hello
I would like to simply protect a single page of my application with a password, is this possible?

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: simply protect a single page

Post by onoehring » 2021-03-08 10:56

Hi,

not with AG possibilities at this time (afaik).

Just as a starting point:
You could use the /hooks/tablename.php -> _init function: Place some code there that
a) checks, if a session variable is set,
-> if yes, allow access to the page,
-> if no, set the return value to false and forward to another (custom) page (and set the return value to false). On that (custom) page ask for the password, if it's correct set the session variable, return to your (protected) page. If the password is wrong, stay on the password page.

Olaf

pfrumkin
Veteran Member
Posts: 157
Joined: 2020-02-18 17:58
Location: Albuquerque, New Mexico USA

Re: simply protect a single page

Post by pfrumkin » 2021-03-08 16:04

Could you not protect using membership in a group (embed that protection in the hook for that table)? Then there login password would effectively be that page protection.

~Paul


Post Reply