Verify that a user has already activated your account by email, otherwise remind you to enable [closed]

-1

I'm developing a corporate network, and I'd like to check it every time the user logged in, whether or not he activated his account via the token sent to his email. But I do not want this check to be done all the time, is that possible?

For example, as long as the user does not activate their account, the system will check to see if the flag in the database "enabled" is as true , but after it becomes true , this account would never need to be checked again because it has already been activated.

Regardless of the technology (language) used, I would like to know if it is computationally possible, through some logic, to create an algorithm that was used until a certain parameter was met, and after that the code "would no longer be executed" (would be discarded from the source code, something of the kind). Because it depends on a particularity that needs to be verified, but once verified as true it would not be necessary to have this code snippet anymore, however each user has his particular token verification, he could not simply remove it from the code, since in some time either user would need the verification.

Postponing is not trivial, it is more conceptual, whether it is possible or not, regardless of the language used.

    
asked by anonymous 25.02.2016 / 19:11

1 answer

1

Logic will be something like this:

In the database in the user table, the field, for example, user_ative=false and when the user activates the account, changes to user_ative to true ...

During log-in of user, you retrieve in the same query , if possible (depending on your data structure, if the field is in the same user table), and with that it passes this parameter via GET , POST or SESSION to avoid performing new queries on other pages to perform the verification, since it is not possible for several users to have different source codes, which makes it impossible for an algorithm to be executed once in the life of that user.

    
25.02.2016 / 19:22