[GameMode] [MySQL/SQLite] Advance Login & Register System (base script)
#1

Advance Login & Register System
MySQL and SQLite - v2.0 - last updated 5th Jan, 2017
  • Dialogs based login and register. There is a limit on login attempts (default is 3) you can edit the limit in script:
    PHP Code:
    #define MAX_LOGIN_ATTEMPTS 3
    #define MAX_ACCOUNT_LOCKTIME 2 // in minutes - this is the time interval for locking the account when a user fails to login in Max Attempts given 
    http://i.imgur.com/lD8XDLm.jpg

  • SECURE_PASSWORD_ONLY
    This forces the user to have atleast 1 Lowercase, 1 Highercase and 1 Number in their password while registration or changing password.
    Modify in script:
    PHP Code:
    //#define SECURE_PASSWORD_ONLY // this forces the user to have atleast 1 Lowercase, 1 Highercase and 1 Number in their password 
  • Per player based password salts, every player has their own SALT for SHA256 salt.

  • When you are unsure about your login credentials, there is a button "OPTIONS" in login or register dialog:


    • Forgot password: gives a dialog where you can answer your security question and reset password:


      When you answer it right (note: you are given the same number of max tries as given in login)


    • Forgot username: gives a dialog where you can get all the accounts that are registered on your IP Address (it cover IP range)!

  • This is what happens when you fail all login attempts:
    The accounts gets temp locked for the given time "MAX_ACCOUNT_LOCKTIME" only for your IP. in case the original user isn't being abused by fake attempts from other IP.s.

    You can also set the maximum login attempts via setting: (note this value also sets maximum attempts to reset password through answering security question)
    PHP Code:
    #define MAX_LOGIN_ATTEMPTS 3 
    Account getting locked (when you fail all 3 attempts):


    When you try to come back right after:


  • /changepass
    Change your account's password. (salt remains the same)


  • /changeques
    Change your account's security question and answer. (salt remains the same)



    You can also add your own questions list by editing this constant array:
    PHP Code:
    new const SECURITY_QUESTIONS[][MAX_SECURITY_QUESTION_SIZE] =
    {
        
    "What was your childhood nickname?", ...
    }; 
  • /stats
Download
SQLite Version - https://github.com/Agneese-Saini/SA-...ase/sqlite.pwn
MySQL Version - https://github.com/Agneese-Saini/SA-...base/mysql.pwn

Libraries required:
zcmd.inc - https://sampforum.blast.hk/showthread.php?tid=576114
sscanf2.inc - https://sampforum.blast.hk/showthread.php?tid=602923
easydialog.inc - https://sampforum.blast.hk/showthread.php?tid=602886
kickban.inc - https://github.com/Agneese-Saini/SA-...kickbanfix.inc
Reply
#2

Awesome and very useful for beginners, keep it up.
Reply
#3

Nicely done!
Reply
#4

Nice Job, But didn't this a Filterscirpt? Because its a Login & Register System not a gamemode...
Reply
#5

Quote:
Originally Posted by RedRex
View Post
Nice Job, But didn't this a Filterscirpt? Because its a Login & Register System not a gamemode...
Its a starter gamemode; you can implement this as a filterscript if you want it to be as a seperate script as an admin system maybe. But i always integrate with my gamemode, so that's why.
Reply
#6

hey dude, good job for a simple gamemode
but i have question about this
Quote:

inputtext[i] |= 0x20;

and its why did you use '|=' and please explain the usage of this '|' and why have you used it with '='
Reply
#7

Quote:
Originally Posted by KokyZ
View Post
hey dude, good job for a simple gamemode
but i have question about this

and its why did you use '|=' and please explain the usage of this '|' and why have you used it with '='
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.
Reply
#8

Great man :O
Reply
#9

Anyone have register system =)?, great joob man
Reply
#10

Is there gonna be the mysql version as u mentioned Gammix?
Reply
#11

Quote:
Originally Posted by bogushas
Посмотреть сообщение
Is there gonna be the mysql version as u mentioned Gammix?
Ofcourse, this week I'll release it. Busy in work for now.
Reply
#12

Thanks for the release Gammix, great work! I'm mixing it with the login system i have for my Zombie Apocalypse Roleplay server https://sampforum.blast.hk/showthread.php?tid=609856

I'll be waiting for the mysql version very anxiously !
Reply
#13

Nice
Reply
#14

I don't like the idea of account being temporarily locked. Imagine someone who could simply get other accounts temporarily locked by typing in the wrong password. What if it's there's an emergency to be in server? Servers having limited offers could get this to be a problem. I'd block the IP temporarily if they kept on exceeding the limits over MULTIPLE accounts at a short period of time.
Reply
#15

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
I don't like the idea of account being temporarily locked. Imagine someone who could simply get other accounts temporarily locked by typing in the wrong password. What if it's there's an emergency to be in server? Servers having limited offers could get this to be a problem. I'd block the IP temporarily if they kept on exceeding the limits over MULTIPLE accounts at a short period of time.
Just remove the feature then?
Reply
#16

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
I don't like the idea of account being temporarily locked. Imagine someone who could simply get other accounts temporarily locked by typing in the wrong password. What if it's there's an emergency to be in server? Servers having limited offers could get this to be a problem. I'd block the IP temporarily if they kept on exceeding the limits over MULTIPLE accounts at a short period of time.
Actually that's a better solution. I'll make a new table for temp blocked IPs to a specific account ID (foreign key).
Reply
#17

Quote:
Originally Posted by Wolfe
Посмотреть сообщение
Just remove the feature then?
It's not up to me because I'm not going to use this. But a lot of others might find it helpful which is why I've suggested it to the script developer.
Reply
#18

Great Login/Register system
+rep
Reply
#19

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Ofcourse, this week I'll release it. Busy in work for now.
Are u gonna release it with the newest mysql version (r41-2 ( think so ))?
Reply
#20

Nicely done man! Going to use it maybe!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)