Advertisement
Guest User

Untitled

a guest
Sep 18th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.96 KB | None | 0 0
  1. -- Create New User Account
  2. -- Enter User information to these variables
  3. SET @str_username = 'CoolGuy'; -- Enter the username provided between the ''  
  4. SET @str_password = 'SuperSecret'; -- Enter the password provied between the ''
  5. SET @str_UserIPAddress = '192.168.1.1'; -- Enter the IP Address of the user between the ''
  6. SET @int_AccessLevel = 0; -- Enter the access level for the user account
  7.                                   -- 0=basic 3=advocate 4=sentinel 6=admin
  8.  
  9. -- The following are static variables do not touch unless you know what you are doing.
  10.  SET @str_password_salt = LOWER(conv(floor(rand() * 99999999999999), 20, 36));
  11.  SET @str_password_hash = LEFT(SHA2(CONCAT(LOWER(@str_password),@str_password_salt),512),64);
  12.  
  13.  
  14.      
  15. -- Add new account
  16. INSERT INTO `accounts` ( `username`, `password`, `password_salt`, `date_created`, `access`, `created_ip_address`) VALUES
  17. (@str_username, @str_password_hash, @str_password_salt, UNIX_TIMESTAMP(), @int_AccessLevel, @str_UserIPAddress);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement