Security question

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
User avatar
lramirez
Veteran Member
Posts: 85
Joined: 2019-11-01 23:23

Security question

Post by lramirez » 2025-01-31 14:08

Hello good morning... Could it be possible to ask for an answer to a security question, right after logging in with the username and password? Only the first time you log in?
I wanted to know if that would be possible in Appgini?
Thanks
Luis Ramirez R.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1709
Joined: 2018-04-01 10:12

Re: Security question

Post by pbottcher » 2025-01-31 16:51

Hi Luis,

indeed you should be able to do so. After the login (in the __global.php -> login_ok) < you could check if the logged in user has not yet answered to a security question (this can be done by having a table to store all logins that already answered the question). If not answered, redirect the user to a page with a security question. Otherwise just continue.

On the security question page, upon successful completion, add this user to the table that you created to log all successful users that answered the security question .

Hope that gives a starting point.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1944
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Security question

Post by jsetzer » 2025-01-31 17:10

That's a perfect answer, @pböttcher!

I'd kindly like to add, AppGini provides PHP-functions getUserData() and setUserData() which allow us to store and retrieve user dependent settings without additional tables.

Anyway, it depends on your requirements if an additional table makes sense and could be used for more user specific configuration options or so.

If this was only that one setting (or only a couple of), personally I would go with getUserData() / setUserData().

Just my 2 ¢
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 25.10 + all AppGini Helper tools

Post Reply