SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Gamemode Scripts

Reply
 
Thread Tools Display Modes
Old 05/01/2017, 07:48 PM   #21
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,637
Reputation: 625
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Update v2.0:
- Now failed login attempts will block the user's IP who was attempting to login not the whole account. So for example if you are trying to login into your friend's account and you fail, your friend would still be able to login (assume they both are not on wifi) but the account will be temp locked for your IP.
__________________

Retired from SA-MP


Gammix is online now   Reply With Quote
Old 05/01/2017, 07:59 PM   #22
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 11,094
Reputation: 2647
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Security questions should probably be stored in the database as well and referential integrity enforced. If the array is changed the security questions won't match up anymore (unless extreme care is taken to only add new questions to the end of the list).

For the IpToLong function; since you are already using sscanf you can use that to very simply explode the IP parts.

PHP Code:
sscanf(ip"p<.>a<i>[4]"val
__________________
Vince is offline   Reply With Quote
Old 06/01/2017, 05:25 AM   #23
SickAttack
Godfather
 
Join Date: Dec 2013
Posts: 5,172
Reputation: 751
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Quote:
Originally Posted by Gammix View Post
https://www.tutorialspoint.com/cprog..._operators.htm

I used it to convert everything to lowercase, as security answers are not case sensitive.
0x20 is equal to a ' ' (space), so "|=" sets the character to a lowercase if its in upper.
You need to check if the character ranges from A to Z; otherwise, it will convert special characters to something else.
SickAttack is offline   Reply With Quote
Old 06/01/2017, 05:39 AM   #24
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,637
Reputation: 625
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Quote:
Originally Posted by Vince View Post
Security questions should probably be stored in the database as well and referential integrity enforced. If the array is changed the security questions won't match up anymore (unless extreme care is taken to only add new questions to the end of the list).

For the IpToLong function; since you are already using sscanf you can use that to very simply explode the IP parts.

PHP Code:
sscanf(ip"p<.>a<i>[4]"val
I'll use that nice little sscanf alternative. And i'll make an update saving the security question text instead of ID so the array will be only used when Registering or Changing Security Question.

Quote:
Originally Posted by SickAttack View Post
You need to check if the character ranges from A to Z; otherwise, it will convert special characters to something else.
I'll use tolower instead!
EDIT: Actually all i need was the hash which i am even getting from '|='. I don't save the raw/original password somewhere so i guess we are fine.
__________________

Retired from SA-MP



Last edited by Gammix; 06/01/2017 at 11:59 AM.
Gammix is online now   Reply With Quote
Old 06/01/2017, 07:30 AM   #25
Bolex_
Gangsta
 
Bolex_'s Avatar
 
Join Date: Aug 2015
Location: Croatia
Posts: 539
Reputation: 94
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

I love your scripting! Expecting MYSQL version soon
Bolex_ is offline   Reply With Quote
Old 06/01/2017, 08:35 AM   #26
Variable™
Gangsta
 
Join Date: Jul 2015
Location: Fort Carson
Posts: 621
Reputation: 105
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Quote:
Originally Posted by Scripter18 View Post
I love your scripting! Expecting MYSQL version soon
This is your second reply to the thread .. You could have edited the first one already.

OT: Not bad.
__________________
Legendary Warriors IP: 5.196.162.107:7777
Website: http://warsamp.tk/ | Forums: http://warsamp.tk/forum | UCP: http://warsamp.tk/UCP-WT | Discord: https://discord.gg/GMxZwnD
Variable™ is offline   Reply With Quote
Old 06/01/2017, 11:53 AM   #27
Loinal
Gangsta
 
Loinal's Avatar
 
Join Date: Feb 2016
Posts: 885
Reputation: 9
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Useful
__________________
Loinal is offline   Reply With Quote
Old 15/01/2017, 12:36 PM   #28
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,637
Reputation: 625
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Update v2.1:
- Security questions are saved as strings instead of saving the array index to retrieve security question later on. This will give scripter advantage of changing the array of security question anytime without effecting user data.
- IpToLong removed upon sscanf. (thanks to Vince)
__________________

Retired from SA-MP


Gammix is online now   Reply With Quote
Old 16/01/2017, 05:30 PM   #29
Slawiii
Huge Clucker
 
Slawiii's Avatar
 
Join Date: May 2015
Location: Morocco, Missour
Posts: 293
Reputation: 16
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Good job man
__________________

[FilterScript] SVIP System (0.01%)
Slawiii is offline   Reply With Quote
Old 17/01/2017, 02:20 PM   #30
darkhunter332
Huge Clucker
 
darkhunter332's Avatar
 
Join Date: Aug 2013
Posts: 241
Reputation: 24
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

This is very useful thing!
darkhunter332 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to disable Register/Login system in a script Sunehildeep Scripting Help 9 03/08/2016 02:57 PM
I am getting a mysql register and login script and im getting a error kingcrome Scripting Help 1 28/10/2013 10:27 PM
[FS] SQLite Register/Login system Hardwell Salonul Scripturilor 2 03/09/2013 10:30 AM
[FS] SQLite Register/Login system Hardwell Română/Romanian 4 31/10/2012 09:11 PM


All times are GMT. The time now is 03:29 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.