-2
I am developing a corporate network, and would like to check every time the user logged in, whether or not he activated his account through the token
sent to your email. But I wouldn’t want that check to be done all the time, this is possible?
For example, while the user does not activate his account, the system will be checking whether the flag in the database "enabled" is as true
, but after she’s as true
, never again would this account need to be verified again, as 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 that code "would no longer be executed" (would be dropped from source code, something like that). Because it depends on a particularity that needs to be checked, but once checked as true
it would no longer be necessary to have this code snippet, but each user has his particular token check, he could not simply remove this snippet from the code, because at some point one or other user would need the verification.
Postponing that it is not something trivial, it is more conceptual, whether it is possible or not, regardless of the language used.
But what technology, what language is working, I believe we lack more details to start wondering if we can help you in something!
– Ale
Yes, it is possible and depends a little on how your application was developed and also on the language.
– Clayderson Ferreira
Hello, @Alexandrec.Caus, 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 has been met, and after that that code would no longer be executed. Because it depends on a particularity that needs to be checked, but once checked as true it would no longer be necessary to do it.
– Maicon Herverton
A have yes, I like to use Delphi, have you ever seen talk? It’s a beauty, it’s desktop application, and the learning curve is smaller than the others (java, c..).. It’s easy to interface, has a good..
– Ale
Basically, if the code is there, it will be executed, there is no escape. The solutions are: force the application to rewrite that part of the code (if it is web is easy, if it is desktop is complicated), but this would have the problem of leaving it useless for new users, if you need a "CTRL+C, CTRL+V", or create another condition that prevents verification, And in that second case, it would still continue to run the condition, but it would not be met. The advantage of the second condition is that as you will run the application on a corporate network, you will not have to check on the network.
– Clayderson Ferreira
@Claydersonferreira is almost that of the second option, only that I am thinking of something of the type of the answer of António campos, but turned to the "log-in", as a corporate network (similar to a social network) has many queries, wanted to avoid doing this check all the time via database query, but when the user logs in it is mandatory to do a query in the bank, at that time I can recover the variable "enabled" and pass it via GET to avoid queries, optimizing the code, what they find?
– Maicon Herverton
This should occur every time the user logs in, or only once in each user’s life?
– Guilherme Nascimento
Just this @Guilhermenascimento, will only occur once in each user’s life.
– Maicon Herverton
I don’t know if the title is right, but I think it makes more sense now.
– Guilherme Nascimento
In fact, it would avoid repeating a check since it has already been answered! but I think it was cool! I asked Stacken the same question, and I liked the guy’s answer, it went something like this: "If you rely on a flag to verify that the user is active, there is no way to fail to do this check, what can be done is to optimize this check right away in the user’s authentication". Thanks a lot.
– Maicon Herverton