Page 1 of 1

simply protect a single page

Posted: 2021-03-08 10:50
by pasbonte
Hello
I would like to simply protect a single page of my application with a password, is this possible?

Re: simply protect a single page

Posted: 2021-03-08 10:56
by onoehring
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

Re: simply protect a single page

Posted: 2021-03-08 16:04
by pfrumkin
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

Re: simply protect a single page

Posted: 2021-03-10 09:47
by onoehring
Hi,

yes, Pauls solution sounds good too :-)

Olaf