Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Registering logins to the nuBuilder database

Questions related to using nuBuilder Forte.
Post Reply
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Registering logins to the nuBuilder database

Unread post by Janusz »

Hi, recently there was few topics how to get the client computer IPs and how to register logins.
As an example you can have a look on my implementation for the registration of the client IP's both for the successful and unsuccessful logins.
https://nubuilderforte.blogspot.com/
If you like nuBuilder, please leave a review on SourceForge
miasoft
Posts: 156
Joined: Wed Dec 23, 2020 12:28 pm
Location: Russia, Volgograd
Has thanked: 32 times
Been thanked: 7 times
Contact:

Re: Registering logins to the nuBuilder database

Unread post by miasoft »

Thx, Janusz! Very useful information. Still would get the StorageProcedure's source code , so as not to reinvent the wheel. :)
Wbr, miasoft.
icoso
Posts: 181
Joined: Sun Feb 07, 2021 11:09 pm
Been thanked: 1 time

Re: Registering logins to the nuBuilder database

Unread post by icoso »

Janusz wrote:Hi, recently there was few topics how to get the client computer IPs and how to register logins.
As an example you can have a look on my implementation for the registration of the client IP's both for the successful and unsuccessful logins.
https://nubuilderforte.blogspot.com/
Where can we get the programming code for this IP Address Logger?
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: Registering logins to the nuBuilder database

Unread post by Janusz »

Hi,
I have just added the code to the Blog.
https://nubuilderforte.blogspot.com/
If you like nuBuilder, please leave a review on SourceForge
apmuthu
Posts: 249
Joined: Sun Dec 06, 2020 6:50 am
Location: Chennai, India, Singapore

Re: Registering logins to the nuBuilder database

Unread post by apmuthu »

Your code in the blog is attached here.
record_logins_Code.txt
Consider the hypothetical situation where a record exists for zx_IPs_id=ip but with
ips_OK_qty+ips_Bad_qty = 0
OR
(ips_OK_qty = 0 AND ips_Bad_qty = 0)
the INSERT parts would fail.

Quick Fix:
INSERT IGNORE....

Better Fix:
UPDATE statement on DUPLICATE Primary Key


The English Auto-generated (and corrected) transcript (remove the .txt extension) of the video is attached.
nuBuilder - record logins to DB.srt
You do not have the required permissions to view the files attached to this post.
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: Registering logins to the nuBuilder database

Unread post by Janusz »

apmuthu wrote:
Consider the hypothetical situation where a record exists for zx_IPs_id=ip but with
ips_OK_qty+ips_Bad_qty = 0
OR
(ips_OK_qty = 0 AND ips_Bad_qty = 0)
the INSERT parts would fail.
Such situation is not possible.
Always initial insert is setting the ips_OK/Bad_qty value to 1:

Code: Select all

...
INSERT INTO zx_IPs (zx_IPs_id,ips_OK_qty) VALUES (ip,1);
....
INSERT INTO zx_IPs (zx_IPs_id,ips_Bad_qty,ips_last_bad,ips_Bad_username) VALUES (ip,1,NOW(),user);
If you like nuBuilder, please leave a review on SourceForge
Post Reply